WebFlash
WebFlash is a library to display "flash" messages in python web applications. These messages are usually used to provide feedback to the user (eg: you changes have been saved, your credit card number has been stolen, ...). One important characteristic they must provide is the ability to survive a redirect (ie: display the message in a page after being redirected from a form submission).
- WebFlash is implemented using cookies so no state must be kept in the server.
- The messages can be rendered by the browser using Javascript. This allows pages to be cached more easily.
- The messages can alternatively be rendered by the server in the html response so JS can be disabled and still work
- The JS code is small (~1Kb) and has no dependency on any library
- The Python code is small and has no dependency outside of the standard library (if using Python 2.6, else simplejson is needed)
- WebFlash is designed to be used in WSGI frameworks with a WebOb-like Reuqest/Response objects. (only a Response object with a set_cookie(name, value) method is needed if using JavaScript? to display messages)
This library has been inspired by this blog post
This library is used by the TurboGears 2 framework and Rum
This is the latest development snapshot
