Metadata-Version: 2.3
Name: django_firestore_session_engine
Version: 1.1
Summary: This is a simple Django Session Engine that uses Firestore as the database to store session data.
Project-URL: Homepage, https://github.com/resun-c/django-firestore-session-engine
Project-URL: Issues, https://github.com/resun-c/django-firestore-session-engine/issues
Author-email: _resun <resun.saif@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Django Firestore Session Engine

This is a simple [`Django Session Engine`](https://docs.djangoproject.com/en/dev/topics/http/sessions) 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`](https://docs.djangoproject.com/en/dev/topics/http/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 <a href="mailto:saif.resun@outlook.com">saif.resun@outlook.com</a>

Cheers!