mongodb as Django sessions backend
Project description
- Info:
mongodb as Django sessions backend
features
fast NoSQL Django sessions backend
invalidation via TTL
installation
run pip install django-mongo-sessions
set mongo_sessions.session as session engine:
SESSION_ENGINE = 'mongo_sessions.session'
settings
there is two ways to setup mongodb connection at settings.py
first, if already have mongo connection, like:
import pymongo from pymongo import MongoClient connection = MongoClient() MONGO_CLIENT = connection.your_database MONGO_SESSIONS_COLLECTION = 'mongo_sessions' # default option
second, if you need to connect to mongodb, like:
MONGO_PORT = 27017 MONGO_HOST = 'localhost' MONGO_DB_NAME = 'test' MONGO_DB_USER = False MONGO_DB_PASSWORD = False MONGO_SESSIONS_COLLECTION = 'mongo_sessions' # all this settings are defaults, you can skip any
tests:
pip install tox tox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-mongo-sessions-0.0.2.tar.gz
.
File metadata
- Download URL: django-mongo-sessions-0.0.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a865c5723129da378de87115684738bd86d4cb219caaf6be090cd7f604183a5 |
|
MD5 | 7075de708dcaffb1a3e527607086556c |
|
BLAKE2b-256 | 0b0451554548ff6cc7361ddb842ed4394c764ec10c87e8eb896cec00c9a8c93d |