[Django] #20863: Sessions backend changing could be clearer

6 views
Skip to first unread message

Django

unread,
Aug 5, 2013, 10:42:05 AM8/5/13
to django-...@googlegroups.com
#20863: Sessions backend changing could be clearer
-----------------------------------------+--------------------
Reporter: Keryn Knight <django@…> | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------------+--------------------
Between #20444 and #20418, the
[https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cookie-
based-sessions cookie based sessions] now includes useful notes explaining
how cookies differ, and specifically, there is a note which reads:

''When using cookies-based sessions `django.contrib.sessions` can be
removed from `INSTALLED_APPS` setting because data is loaded from the key
itself and not from the database, so there is no need for the creation and
usage of `django.contrib.sessions.models.Session` table.''

In light of that explanation, it's not clear why it is singled out as the
only one that can remove `django.contrib.sessions` from the
INSTALLED_APPS. Can any of the others? The answer is, according to the
documentation ... unclear; there is a paragraph at the end of the
[https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-
sessions cached sessions docs] which suggests using `cached_db` requires
following the [https://docs.djangoproject.com/en/dev/topics/http/sessions
/#using-database-backed-sessions database sessions setup], which involves
having `django.contrib.sessions` installed. So by implication, using the
**cached** backend (rather than the **cached_db**) shouldn't require
following the same setup requirements. The **file** based caching gets
such a cursory mention, it could go either way.

As part of the ticket, I think the highlighted point about the cached_db
requirements ought to be a Sphinx `.. note::`, as it is only in reading &
re-reading these docs to draft this ticket that I noticed it.

--
Ticket URL: <https://code.djangoproject.com/ticket/20863>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 6, 2013, 11:36:44 AM8/6/13
to django-...@googlegroups.com
#20863: Sessions backend changing could be clearer
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:1>

Django

unread,
Sep 22, 2013, 6:41:30 PM9/22/13
to django-...@googlegroups.com
#20863: Sessions backend changing could be clearer
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by EvilDMP):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:2>

Django

unread,
Oct 9, 2013, 1:14:34 PM10/9/13
to django-...@googlegroups.com
#20863: Clarify which session backends require django.contrib.sessions in
INSTALLED_APPS

-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by timo):

As far as I can tell, only `db` and `cached_db` require the
`INSTALLED_APPS` entry.

--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:3>

Django

unread,
Nov 9, 2013, 5:29:26 AM11/9/13
to django-...@googlegroups.com
#20863: Clarify which session backends require django.contrib.sessions in
INSTALLED_APPS
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by jdetaeye@…):

Also the unit test framework refers to django.contrib.sessions.

I read the same sentence in the documentation, and removed
django.contrib.sessions from my INSTALLED_APPS. My tests all started to
fail.
After some analysis I found the methods django.test.client.login and
django.test.client._session don't behave the same any more.

Either the documentation needs some extra note on this, or (preferably
imho) a seperate ticket needs to be filed to make the test framework work
better also without django.contrib.sessions in the INSTALLED_APPS setting.

--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:4>

Django

unread,
Nov 9, 2013, 5:40:16 AM11/9/13
to django-...@googlegroups.com
#20863: Clarify which session backends require django.contrib.sessions in
INSTALLED_APPS
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

See ticket 20915 on this dependency.

--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:5>

Django

unread,
Feb 8, 2014, 8:20:31 AM2/8/14
to django-...@googlegroups.com
#20863: Clarify which session backends require django.contrib.sessions in
INSTALLED_APPS
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* easy: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:6>

Django

unread,
Jul 9, 2014, 2:11:50 PM7/9/14
to django-...@googlegroups.com
#20863: Clarify which session backends require django.contrib.sessions in
INSTALLED_APPS
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: closed
Type: | Version: master
Cleanup/optimization | Resolution: wontfix

Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => wontfix


Comment:

I
[https://github.com/django/django/commit/3a85aae2eacae836e2a92de77615569883b81932
removed the advice] of removing `django.contrib.sessions` from
`INSTALLED_APPS` as a solution to avoid creating the database tables due
to the other side effects and filed a new ticket (#22986) for a proper
solution.

--
Ticket URL: <https://code.djangoproject.com/ticket/20863#comment:7>

Reply all
Reply to author
Forward
0 new messages