Skip to main content

This is a simple Django Session Engine that uses Firestore as the database to store session data.

Project description

Django Firestore Session Engine

This is a simple Django Session Engine that uses Firestore as the database to store session data.

Instalation

pip install --index-url https://test.pypi.org/simple/ --no-deps django-firestore-session-engine

Setup & Usage

1. Add django-firestore-session-engine to the INSTALLED_APPS list in settings.

INSTALLED_APPS = [
    ...,
    'django-firestore-session-engine'
]

2. In settings, set SESSION_ENGINE to django-firestore-session-engine.engine

SESSION_ENGINE = 'django-firestore-session-engine.engine'

3. initialize a firestore collection and set it to FIRESTORE_SESSION_COL in settings.

FIRESTORE_SESSION_COL = FIRESTORE.collection("session")

Tips

Do not 'initialize' Firestore or 'import' initialized Firestore in more than one file while using it with Djnago. A good practice is to initialize firestore in the settings file and import it from there.

Acknowledgements

This Engine was made based on what is described in the Djnago documentation on How to use sessions and after some reverse-engineering of the existing session engines, especially the 'django.contrib.sessions.backends.db' and 'django.contrib.sessions.backends.file' engines.

Please send any comments and criticisms to the author here saif.resun@outlook.com

Cheers!

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

django_firestore_session_engine-1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_firestore_session_engine-1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file django_firestore_session_engine-1.0.tar.gz.

File metadata

File hashes

Hashes for django_firestore_session_engine-1.0.tar.gz
Algorithm Hash digest
SHA256 a988908b03ddb98766b11f2ff78bd01ef0decd25684d15765047955c38b16236
MD5 6cc6f07015c2e1c94c348ba0617370ab
BLAKE2b-256 c90c2a48c326c26410dd7445a90468273eed298899911b074f3b253b2609495d

See more details on using hashes here.

File details

Details for the file django_firestore_session_engine-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_firestore_session_engine-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b3bf4f89c1346a86ba6e2d7b9a468f7ce32858206661fc15f3becc025adb6c0
MD5 12020db1dc79849b527d24f8939dccb2
BLAKE2b-256 355e58cc67cf993e85a6f1e966423d6fdd2b8fea4c4349d662d629936ddc9a7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page