The only things to use for django sessions mentioned by you and other users are:
1- Add SessionMiddleware to MiddlewareClasses (you already have):
MIDDLEWARE_CLASSES = ( # Default Django middleware. 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', )
2- Add django.contrib.sessions to installed applications (you already have):
DJANGO_APPS = ( # Default Django apps: 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', )
3- Database synchronization after changing middleware and DjangoApps:
python manage.py syncdb
Now that you have done all this, the sessions should work because they are no more. After you make all these changes, try to start searching for your website with or without different users, and you should get some information growing in the django_session table
You should check the session documentation in Django using sessions in views
source share