{"id":26906,"library":"django-redis-sessions","title":"django-redis-sessions","description":"A Redis session backend for Django, providing high-performance session storage. Current version is 0.6.2, released in 2017. The project is in maintenance mode with no recent updates.","status":"maintenance","version":"0.6.2","language":"python","source_language":"en","source_url":"http://github.com/martinrusev/django-redis-sessions","tags":["django","redis","sessions","backend"],"install":[{"cmd":"pip install django-redis-sessions","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required as the session framework","package":"django","optional":false},{"reason":"Python Redis client","package":"redis","optional":false}],"imports":[{"note":"Direct import of SessionStore for custom session backends","wrong":"","symbol":"session_engine","correct":"from redis_sessions.session import SessionStore"}],"quickstart":{"code":"# In settings.py\nSESSION_ENGINE = 'redis_sessions.session'\n# Optional Redis connection settings (use env vars for secrets)\nSESSION_REDIS = {\n    'host': os.environ.get('REDIS_HOST', 'localhost'),\n    'port': 6379,\n    'db': 0,\n    'password': os.environ.get('REDIS_PASSWORD', ''),\n    'prefix': 'session',\n    'socket_timeout': 1\n}","lang":"python","description":"Configure Django to use Redis sessions by setting SESSION_ENGINE and optionally SESSION_REDIS dict. Ensure redis is running."},"warnings":[{"fix":"Use dict format: SESSION_REDIS = {'host': ..., 'port': ..., ...}","message":"SESSION_REDIS must be a dict, not a string. If you set SESSION_REDIS as a Redis URL string (e.g., 'redis://...'), it will be ignored silently and fall back to defaults.","severity":"gotcha","affected_versions":"all"},{"fix":"For Django 4+, ensure you have no deprecated settings; test session behavior.","message":"Django versions 4.x and later removed the PREFERRED_SESSION_COOKIE_SALT setting; if using combined with sessions_cached_db, be aware of changes in session backend.","severity":"deprecated","affected_versions":"0.6.x"},{"fix":"Use simple prefix without colons or use a separate Redis db.","message":"The prefix option in SESSION_REDIS does not support nested keys; if you use colons in prefix (e.g., 'project:session'), it will be treated as literal. May cause namespace collisions.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace SESSION_REDIS_HOST, SESSION_REDIS_PORT, etc. with SESSION_REDIS = {'host': ..., 'port': ...}","message":"In version 0.6, the configuration changed from separate settings (SESSION_REDIS_HOST, etc.) to a single SESSION_REDIS dict. Old settings are not automatically migrated.","severity":"breaking","affected_versions":"0.5.x to 0.6"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install django-redis-sessions' and ensure the virtual environment is active.","cause":"Package not installed or virtual environment not activated.","error":"ModuleNotFoundError: No module named 'redis_sessions'"},{"fix":"Start Redis server (e.g., 'redis-server') or check the host/port in SESSION_REDIS.","cause":"Redis server is not running or not reachable.","error":"ConnectionError: Error 111 connecting to localhost:6379. Connection refused."},{"fix":"Set SESSION_ENGINE = 'redis_sessions.session' and ensure django-redis-sessions is installed.","cause":"Incorrect SESSION_ENGINE value or missing dependencies.","error":"django.core.exceptions.ImproperlyConfigured: SESSION_ENGINE is not installed or is invalid."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}