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 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.1.tar.gz (4.7 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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_firestore_session_engine-1.1.tar.gz
Algorithm Hash digest
SHA256 2889250f58d459750181ae14a0c51cb16ed0844be81a791ff3912581c80b6174
MD5 46f59c67a0287933397c317c167d728a
BLAKE2b-256 726cf45cf2da1700d43c73bc0094f75c86669e5799c30fe2c1e5f8e47c0ea583

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_firestore_session_engine-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 528648ec35bb40354a8a504701e245e50ad47744b49d2b94a7ae84c53d35bd1e
MD5 6d4d310a766bd671b496bea335bb282d
BLAKE2b-256 9cac821e5684ef56efed55ba64457adcad28b0c61e0d97de0c12778e444509e8

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