Opened 11 years ago

Closed 10 years ago

#20863 closed Cleanup/optimization (wontfix)

Clarify which session backends require django.contrib.sessions in INSTALLED_APPS

Reported by: Keryn Knight <django@…> Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Between #20444 and #20418, the 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 cached sessions docs which suggests using cached_db requires following the 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.

Change History (7)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Daniele Procida, 11 years ago

Easy pickings: set

comment:3 by Tim Graham, 11 years ago

Summary: Sessions backend changing could be clearerClarify which session backends require django.contrib.sessions in INSTALLED_APPS

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

comment:4 by jdetaeye@…, 11 years ago

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.

in reply to:  4 comment:5 by anonymous, 11 years ago

See ticket 20915 on this dependency.

Version 0, edited 11 years ago by anonymous (next)

comment:6 by Tim Graham, 11 years ago

Easy pickings: unset

comment:7 by Tim Graham, 10 years ago

Resolution: wontfix
Status: newclosed

I 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.

Note: See TracTickets for help on using tickets.
Back to Top