Skip to content

Advanced web application framework based on Tornado.

License

Notifications You must be signed in to change notification settings

xkstudio/Torweb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Torweb

Advanced web application based on Tornado.

Version

v1.0.6-Beta

Features

  • Non-blocking Network I/O

  • Session Support (Use Redis Storage)

  • Cookie(Secure Cookie) Support

  • MySQL Support

  • Redis Support

  • Jinja2 Support

  • Internationalization Support (i18n)

Python Support

  • Python 2.6.6

  • Python 2.7.x

  • Python 3.x Not Test

Web Framework

Front Framework

  • Bootstrap 3.3.7 (Not Limit)

  • Font-Awesome 4.7.0 (Not Limit)

  • jQuery 2.2.4 (Not Limit)

Template Egnine

Database Support

Installation

  • yum install MySQL-python

  • pip install tornado

  • pip install redis

  • pip install jinja2

Startup

python run.py

You can visit the site via http://YourIP:8081/

Specify Port:

python run.py --port=8080

Development

Configuration

You can config your MySQL and Redis via settings.py.

Handlers

Add import YourHandler to handler/init.py and add don't forget to add a route.

Templates

  • view/YourHandler/YourTemplate.html

Support for Jinja2, you should do this:

from Template import TemplateLoader
tpl_loader = TemplateLoader(settings['template_path'], False)
tornado.web.Application.__init__(self, handlers, template_loader=tpl_loader.Loader(), **settings)

See the app/Torweb.py for the detail.

Static Files

  • static/css

  • static/js

  • static/img

UI Modules

  • ui_modules/UIModules.py

  • view/ui_modules/YourUIModule.html

Via {{ module YourUIModule(foo) }} use ui modules in template.

Tips: Jinja2 don't support UI Modules

Internationalization

  • locale/en_US.csv

  • locale/YourLocale.csv

Via {{ _('Locale String') }} in your template

License

This project is under the MIT License. See the LICENSE file for the full license text.