A Django session backend with Redis storage.
Project description
Django Redis Session Store
Django Redis Session is a Django session backend that uses Redis as its session store. This package allows multiple Django applications to share user sessions by using the same Redis database as a common session store.
Installation
You can install Django Redis Session with pip:
pip install django_redis_session_store
Configuration
To use Django Redis Session, you need to configure several settings in your Django project's settings.py file:
SESSION_ENGINE = 'django_redis_session_store.session_store'
SESSION_REDIS_HOST = 'localhost'
SESSION_REDIS_PORT = 6379
SESSION_REDIS_DB = 0
SESSION_REDIS_PASSWORD = 'password'
SESSION_REDIS_USER = 'user'
SESSION_REDIS_PREFIX = 'session'
SESSION_REDIS_SOCKET_TIMEOUT = 1800
SESSION_REDIS_TLS = False
Please replace the above settings with the actual configuration details of your Redis server.
Usage
Once Django Redis Session is installed and configured, you can use Django sessions as you would normally. The session data is stored in Redis and can be shared between multiple Django applications.
Use Case
Imagine that you have two Django applications, App1 and App2, both of which require user authentication. When a user logs into App1, a new session is created and stored in the Redis server. Later, the same user tries to access App2. Since App2 uses the same Redis server for session storage, it recognizes the user's session and does not require the user to log in again.
This shared session feature is particularly useful in microservices architectures, where you might have multiple services that each require user authentication.
License
This project is licensed under the MIT license. For more details, see the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-redis-session-store-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bc9bd3b10be96d4700b72c7ae5b499dca64e74b13aa68e08d3d2a4bc10040bc |
|
MD5 | 3dac295b45e1bfef3ade7ecaa6c357ce |
|
BLAKE2b-256 | fcde44cf0f35724bba73e67ad2598b6d2530c967ca01464675efccea35aeff4f |
Hashes for django_redis_session_store-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57bf0eef66c3a0a3f3bc0a1fc96d249935b603ffaf005e57cd213b1d00ba84c8 |
|
MD5 | 201aa608c60c044ddedc1d57221a5270 |
|
BLAKE2b-256 | 2d745a9a7d3985622fe8c9b6f79ab67661e0f2b4774e46b04fe234ab7dfebceb |