mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #23276 -- Added missing url() in some places.
This commit is contained in:
committed by
Collin Anderson
parent
468236889f
commit
e5376999fa
@@ -476,9 +476,11 @@ The login_required decorator
|
||||
Note that if you don't specify the ``login_url`` parameter, you'll need to
|
||||
ensure that the :setting:`settings.LOGIN_URL <LOGIN_URL>` and your login
|
||||
view are properly associated. For example, using the defaults, add the
|
||||
following line to your URLconf::
|
||||
following lines to your URLconf::
|
||||
|
||||
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
|
||||
from django.contrib.auth import views as auth_views
|
||||
|
||||
url(r'^accounts/login/$', auth_views.login),
|
||||
|
||||
The :setting:`settings.LOGIN_URL <LOGIN_URL>` also accepts view function
|
||||
names and :ref:`named URL patterns <naming-url-patterns>`. This allows you
|
||||
@@ -752,7 +754,7 @@ patterns.
|
||||
the view in your URLconf. For example, this URLconf line would use
|
||||
:file:`myapp/login.html` instead::
|
||||
|
||||
(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}),
|
||||
url(r'^accounts/login/$', auth_views.login, {'template_name': 'myapp/login.html'}),
|
||||
|
||||
You can also specify the name of the ``GET`` field which contains the URL
|
||||
to redirect to after login by passing ``redirect_field_name`` to the view.
|
||||
|
||||
@@ -1476,7 +1476,7 @@ Make sure that the following item is in your
|
||||
|
||||
Activate this view by adding the following line to your URLconf::
|
||||
|
||||
(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
url(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
|
||||
(Note that this example makes the view available at ``/i18n/setlang/``.)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user