Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#QTornado Document

Include Part

  • src
    • init_filter.py
    • initial_content.py
    • lib.py
    • Qtornado.py
  • bin
    • Qtornado.py

Introduction

a foolish experence contribute me  to make this ..
this is a very small and simple web framework base on tornado 

Install

pip3 install Qtornado

Useage

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

Example

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

UI module (based on tornado)

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) %}

About

A Python Web framework based on tornado

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages