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.
Comment (by Carlton Gibson):
System checks are [https://docs.djangoproject.com/en/2.2/ref/settings#std
:setting-SILENCED_SYSTEM_CHECKS designed to be silenced if not
appropriate]. I'm inclined to think this just such an edge-case at first
glance.
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:1>
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:2>
* owner: nobody => Aarni Koskela
* status: new => assigned
Comment:
I'll work on a PR, then. :)
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:3>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/11166 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:4>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:5>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
Comment:
Patch is ready and waiting for review.
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:6>
* severity: Normal => Release blocker
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:7>
* type: Cleanup/optimization => Bug
* severity: Normal => Release blocker
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:7>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"efeceba589974b95b35b2e25df86498c96315518" efeceba5]:
{{{
#!CommitTicketReference repository=""
revision="efeceba589974b95b35b2e25df86498c96315518"
Fixed #30312 -- Relaxed admin check from django.contrib.sessions to
SessionMiddleware subclasses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:9>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"a4095dadc4b165f615dfc88c6ed1cbba5b5a9844" a4095dad]:
{{{
#!CommitTicketReference repository=""
revision="a4095dadc4b165f615dfc88c6ed1cbba5b5a9844"
[2.2.x] Fixed #30312 -- Relaxed admin check from django.contrib.sessions
to SessionMiddleware subclasses.
Backport of efeceba589974b95b35b2e25df86498c96315518 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30312#comment:10>