• Django 1.2.3 or later


Please install using pip install django-demo, add it to your requirements file for virtualenv or add it to eggs in your buildout config.

Required Django apps

  • django.contrib.sessions

Required Configurations

  • Put demo.middleware.DemoMiddleware into your MIDDLEWARE_CLASSES, ideally right after the django.contrib.sessions.middleware.SessionMiddleware.
  • Add demo to your INSTALLED_APPS.
  • Set DATABASE_ROUTERS to ['demo.router.DemoRouter'].
  • The database user of your ‘default’ must have the right to create and drop databases.
  • Set up a cronjob or celery task (or another way to run commands in intervals) to call python cleandemos often.
  • If you wish django-demo to manage your file uploads too, set DEFAULT_FILE_STORAGE to ''.
  • If you wish to use caching and isolate that too, set CACHE_BACKEND to 'demo.cache://<realbackend>' where you replace <realbackend> with what you would put as CACHE_BACKEND usually. For local memcached it would be: 'demo.cache://memcached://'.


If you want to enable file management, it will only manage files uploaded using the default storage backend, file and image fields which use a custom storage will not work. You may set a different default storage though by setting the DEMO_FILE_STORAGE setting.


For now, only Sqlite3, MySQL and PostgreSQL are supportd. Other database engines require a custom demo backend, see Demo Backends.

Project Versions

Table Of Contents

Previous topic

Welcome to django-demo’s documentation!

Next topic


This Page