Skip to content

Commit

Permalink
async client can be used as session backend
Browse files Browse the repository at this point in the history
  • Loading branch information
amirreza8002 committed Sep 21, 2024
1 parent 57729f6 commit 508e0c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/source/async/advanced_configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,13 @@ note that ``"CONNECTION_FACTORY"`` overrides ``DJANGO_VALKEY_CONNECTION_FACTORY`

if you want to use another factory you can use the same code with the path to your class.

Configure as session backend
############################

django can by default use any cache backend as a session backend and you benefit from that by using django-valkey as backend for session storage without installing any additional backends:
just add these settings to your settings.py

.. code-block:: python
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default

0 comments on commit 508e0c8

Please sign in to comment.