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.
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.
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.