-
Notifications
You must be signed in to change notification settings - Fork 0
joerussbowman/tornado_flash
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
tornado_flash A simple flash library to be used with Tornado. Data is encoded to json, allowing you store anything that can be json encoded into a cookie. A Basic example. import tornado.web import tornado_flash class MyRequest(tornado.web.RequestHandler): def get(self): flash = tornado_flash.Flash() self.render("index.html", flash=flash) class SetFlash(tornado.web.RequestHandler): def get(self): flash = tornado_flash.Flash() flash.data = {"class": "warning", "msg": "WARNING!"} self.redirect("/") The template can then have: {% if flash.data %} <div class="{{ flash.data["class"] }}"> {{ flash.data["msg"] }} </div> TODO: Build a real demo
About
A simple cookie based flash library for Tornado
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published