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 ...
Get Mastering Django: Core now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.