Configuring the session engine
By default, Django stores sessions in your database (using the model django.contrib.sessions.models.Session
). Though this is convenient, in some setups it's faster to store session data elsewhere, so Django can be configured to store session data on your filesystem or in your cache.
Using database-backed sessions
If you want to use a database-backed session, you need to add 'django.contrib.sessions'
to your INSTALLED_APPS
setting. Once you have configured your installation, run manage.py migrate
to install the single database table that stores session data.
Using cached sessions
For better performance, you may want to use a cache-based session backend. To store session data using Django's cache system, you'll first need to make sure you've configured your cache; see the cache documentation for details.
Note
You should only use cache-based sessions if you're using the Memcached cache backend. The local-memory cache backend doesn't retain data long enough to be a good...