Skip to content
Django-Flash is a simple Django extension which provides support for Rails-like flash messages.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Django-flash is a simple extension to the Django framework which enables the
use of the so called flash scope, first introduced by Ruby on Rails a few
years ago.

This is an open source project licenced under the terms of the Lesser General
Public License v3.0 and sponsored by Destaquenet Technology Solutions, a
brazilian software development and consultancy startup.


The easiest way to install django-flash is via EasyInstall. Follow these
instructions to install EasyInstall if you don’t have it already.

Then, execute the following command line to download and install the latest
stable version from CheeseShop:

    $ sudo easy_install django-flash

If you use git and want to get the latest development version:

    $ git clone git://
    $ cd django-flash
    $ sudo python install

Or get the latest development version as a tarball:

    $ wget
    $ tar zxf danielfm-django-flash-XXXXXXXXXXXXXXXX.tar.gz
    $ cd danielfm-django-flash-XXXXXXXXXXXXXXXX
    $ sudo python install

Configuring your Django project

The first thing to do is plug django-flash to your Django project. To do
this, open your project’s file and do the following changes:


        # django-flash depends on the SessionMiddleware

That’s all the required configuration.

Using django-flash

Once plugged to your project, django-flash automatically adds a flash property
to the HttpRequest objects received by your view methods. This property points
to an instance of djangoflash.models.FlashScope.

Here goes some examples on how to manipulate this scope:

    def my_view(request):
        # Puts a string to the flash scope
        request.flash['key'] = 'value'

        # Same as above

        # Checks if the object is available at the flash scope
        'key' in request.flash

        # Gets an object from the flash scope

        # Same as above, but returns a default value if the key doesn't exists
        request.flash.get('key', 'default value')

        # Removes an object from the flash scope
        del request.flash['key']

Although we are using plain string values, you are free to use any pickleable

That's just the tip of the iceberg!

To learn everything about django-flash, take a look at the the complete
documentation at:

    Author:  Daniel Fernandes Martins <>
    Company: Destaquenet Technology Solutions <>

Something went wrong with that request. Please try again.