From be48c6c19915f78f1378dba8b0c6c41ab8e8ab59 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 29 Aug 2013 14:15:58 -0400 Subject: [PATCH] Fixed #20997 -- Added SessionStore note to docs. Thanks jsdalton. --- docs/topics/http/sessions.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 24b9ef4462240..47be4c668436a 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -454,6 +454,17 @@ Here's a typical usage example:: Using sessions out of views =========================== +.. note:: + + The examples in this section import the ``SessionStore`` object directly + from the ``django.contrib.sessions.backends.db`` backend. In your own code, + you should consider importing ``SessionStore`` from the session engine + designated by :setting:`SESSION_ENGINE`, as below: + + >>> from importlib import import_module + >>> from django.conf import settings + >>> SessionStore = import_module(settings.SESSION_ENGINE).SessionStore + An API is available to manipulate session data outside of a view:: >>> from django.contrib.sessions.backends.db import SessionStore