#30312: Admin app has too hard a dependency on sessions app
-----------------------------------------+------------------------
               Reporter:  Aarni Koskela  |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  contrib.admin  |        Version:  2.2
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Since #29695 (371ece2f0682e51f2f796854d3e091827a7cea63), released in 2.2,
 the admin app checks whether the `django.contrib.sessions` app is in
 `INSTALLED_APPS`.

 Some projects may have opted to use a replacement session management app
 such as https://github.com/QueraTeam/django-qsessions – the admin app
 claims to be incompatible with such a configuration, even if it actually
 means "I'm going to need _some_ session management that works like
 `django.contrib.sessions`".

 Maybe it would be better to get rid of the app check and do what's being
 done for various middleware in the checks function anyway, e.g. something
 like

 {{{
 if not
 _contains_subclass('django.contrib.sessions.middleware.SessionMiddleware',
 settings.MIDDLEWARE):
     errors.append(checks.Error(
         "'django.contrib.sessions.middleware.SessionMiddleware' must "
         "be in MIDDLEWARE in order to use the admin application.",
         id='admin.E4XX',
     ))
 }}}

 – this would be out-of-the-box compatible with e.g. Qsessions.

 The obvious workaround is to just re-add `django.contrib.sessions` back
 into `INSTALLED_APPS` which kinda works, but has the mild but unfortunate
 side effect of forcibly enabling the
 `django.contrib.sessions.models.Session` model and migrations, (re-)adding
 a useless `django_session` table into the database upon migration.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/046.7c6ac1714667423a6672d48b8c8637e2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to