mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31405 -- Added LoginRequiredMiddleware.
Co-authored-by: Adam Johnson <me@adamj.eu> Co-authored-by: Mehmet İnce <mehmet@mehmetince.net> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
committed by
Sarah Boyce
parent
7857507c7f
commit
c7fc9f20b4
@@ -26,6 +26,20 @@ only officially support the latest release of each series.
|
||||
What's new in Django 5.1
|
||||
========================
|
||||
|
||||
Middleware to require authentication by default
|
||||
-----------------------------------------------
|
||||
|
||||
The new :class:`~django.contrib.auth.middleware.LoginRequiredMiddleware`
|
||||
redirects all unauthenticated requests to a login page. Views can allow
|
||||
unauthenticated requests by using the new
|
||||
:func:`~django.contrib.auth.decorators.login_not_required` decorator.
|
||||
|
||||
The :class:`~django.contrib.auth.middleware.LoginRequiredMiddleware` respects
|
||||
the ``login_url`` and ``redirect_field_name`` values set via the
|
||||
:func:`~.django.contrib.auth.decorators.login_required` decorator, but does not
|
||||
support setting ``login_url`` or ``redirect_field_name`` via the
|
||||
:class:`~django.contrib.auth.mixins.LoginRequiredMixin`.
|
||||
|
||||
Minor features
|
||||
--------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user