Skip to content

Instantly share code, notes, and snippets.

@huahu
huahu / app.py
Created January 3, 2014 00:30 — forked from ayang/app.py
class Application(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(self, handlers, **settings)
self.db_session = db_session
self.redis = redis.StrictRedis()
self.session_store = RedisSessionStore(self.redis)
class BaseHandler(tornado.web.RequestHandler):
from wtforms import Form
定义一个类,目的用于获取html的form中的值
class RegistrationForm(Form):
name = TextField('name', [validators.Length(min=4, max=25)])
这个是处理方法,目的是打印获取的值
class ReciveData(RequestHandler):
def post(self):
form = RegistrationForm()