#QTornado Document
Include Part
- src
- init_filter.py
- initial_content.py
- lib.py
- Qtornado.py
- bin
- Qtornado.py
a foolish experence contribute me to make this ..
this is a very small and simple web framework base on tornado
pip3 install Qtornado
usage: it is usage for qingluanTornado
this is a assistant for write web html weite by Qingluan github :
http://github.com/Qingluan
optional arguments:
-h, --help show this help message and exit
-u, --unintall uninstall this project
-c ADD_CONTROLLER, --add-controller ADD_CONTROLLER
-t THEME_CHOICE, --theme-choice THEME_CHOICE
--websocket websocket mode
-e EXTENDS, --extends EXTENDS
this will create a new html by extends another
template
Qtornado.py -p Web_test -i login
this will generate a tree like this :
Web_test
├── manifest.py
├── controller.py
├── main.py
├── setting.py
├── static
└── template
├── index.html
└── login.html
and run web with cd web_test && python main.py to start server
if you want to change port , write setting.py , change port=8080
and you can change your db_engine by overide generated file "setting.py"
db_engine = Mongo('local') # default is mongo db, this engine is QmongoHelper
...
if you want to add a html+controller+router , you can just
cd web_test python manifest.py -c newcontroller
or add some args, like -extends
python manifest.py -c newcontroller -e index
or you want to add a websocket controler
python manifest.py -c newcontroller --websocket
there are some most useful ui modules
{% module Card('title') %}
{% module Inputs(action='/post' ,'account', 'password:passwd', 'checkbox:remember', 'file:slect', type='card') %}
{% module Table(title='title',[header1, header2, header3], *items ,table_type='striped') %}
items example:
[{
'txt':'xxx',
'link': '/index',
'active': '1',
'tq': '1'
},
{
'txt':'xxx',
'link': '/url',
},
{
'txt':'xxx',
'link': '/index2',
}]
{% module Nav(items) %}