Flash Message Template Tag
Flash message add-on for Django. Uses sessions. Behavior is such that you set a flash message in a view. That message is stored in the sesssion. Then whenever it is that the message gets displayed, it is removed from the session (never to be heard from again) **Installation:** In your settings, enable the following items. TEMPLATE_CONTEXT_PROCESSORS django.core.context_processors.request MIDDLEWARE_CLASSES django.contrib.sessions.middleware.SessionMiddleware Then put it into a file called flash.py in your templatetags directory. **Usage:** It's pretty simple. Do something like this in your view .. >>>request.session['flash_msg'] = 'Your changes have been save' >>>request.session['flash_params'] = {'type': 'success'} And maybe put something like this in your template {% load flash %} {% flash %} <h2>{{ params.type }}</h2> {{ msg }} {% endflash %} It also support a flash template, you can specify a file FLASH_TEMPLATE in your settings file and then that file will be rendered with msg and params as available variable. Usage for this would simply be `{% flash_template %}` and then you gotta make a template file that does whatever you like. Outside of that just be aware you need the Django session middleware and request context installed in your app to use this.
- template
- flash
- message