Ticket #16789: t16789-with-docs.diff

File t16789-with-docs.diff, 5.1 KB (added by cmheisel, 4 years ago)

Named URL patterns plus docs

  • django/contrib/auth/urls.py

    diff --git a/django/contrib/auth/urls.py b/django/contrib/auth/urls.py
    index 42b4e8f..b32b796 100644
    a b  
    1 # These URLs are normally mapped to /admin/urls.py. This URLs file is
    2 # provided as a convenience to those who want to deploy these URLs elsewhere.
     1# This URLs file is provided as a convenience to those who want to deploy these URLs elsewhere.
    32# This file is also used to provide a reliable view deployment for test purposes.
    43
    5 from django.conf.urls.defaults import *
     4from django.conf.urls.defaults import patterns, url
    65
    76urlpatterns = patterns('',
    8     (r'^login/$', 'django.contrib.auth.views.login'),
    9     (r'^logout/$', 'django.contrib.auth.views.logout'),
    10     (r'^password_change/$', 'django.contrib.auth.views.password_change'),
    11     (r'^password_change/done/$', 'django.contrib.auth.views.password_change_done'),
    12     (r'^password_reset/$', 'django.contrib.auth.views.password_reset'),
    13     (r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
    14     (r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm'),
    15     (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
     7    url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
     8    url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
     9    url(r'^password_change/$', 'django.contrib.auth.views.password_change', name='password_change'),
     10    url(r'^password_change/done/$', 'django.contrib.auth.views.password_change_done', name='password_change_done'),
     11    url(r'^password_reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'),
     12    url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
     13    url(r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'),
     14    url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete', name='password_reset_complete'),
    1615)
    17 
  • docs/topics/auth.txt

    diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
    index 69f6fd7..08673fa 100644
    a b The login_required decorator 
    823823
    824824.. function:: views.login(request, [template_name, redirect_field_name, authentication_form])
    825825
     826    **URL name:** ``login``
     827
     828    See :doc:`the URL documentation </topics/http/urls>` for details on using named URL patterns
     829
    826830    Here's what ``django.contrib.auth.views.login`` does:
    827831
    828832        * If called via ``GET``, it displays a login form that POSTs to the
    includes a few other useful built-in views located in 
    938942
    939943    Logs a user out.
    940944
     945    **URL name:** ``logout``
     946
     947    See :doc:`the URL documentation </topics/http/urls>` for details on using named URL patterns
     948
     949
    941950    **Optional arguments:**
    942951
    943952        * ``next_page``: The URL to redirect to after logout.
    includes a few other useful built-in views located in 
    970979
    971980    Logs a user out, then redirects to the login page.
    972981
     982    **URL name:** No default URL provided
     983
    973984    **Optional arguments:**
    974985
    975986        * ``login_url``: The URL of the login page to redirect to.
    includes a few other useful built-in views located in 
    979990
    980991    Allows a user to change their password.
    981992
     993    **URL name:** ``password_change``
     994
    982995    **Optional arguments:**
    983996
    984997        * ``template_name``: The full name of a template to use for
    includes a few other useful built-in views located in 
    10031016
    10041017    The page shown after a user has changed their password.
    10051018
     1019    **URL name:** ``password_change_done``
     1020
    10061021    **Optional arguments:**
    10071022
    10081023        * ``template_name``: The full name of a template to use.
    includes a few other useful built-in views located in 
    10241039        will not be able to request a password reset to prevent misuse
    10251040        when using an external authentication source like LDAP.
    10261041
     1042    **URL name:** ``password_reset``
     1043
    10271044    **Optional arguments:**
    10281045
    10291046        * ``template_name``: The full name of a template to use for
    includes a few other useful built-in views located in 
    10991116    password. This view is called by default if the :func:`password_reset` view
    11001117    doesn't have an explicit ``post_reset_redirect`` URL set.
    11011118
     1119    **URL name:** ``password_reset_done``
     1120
    11021121    **Optional arguments:**
    11031122
    11041123        * ``template_name``: The full name of a template to use.
    includes a few other useful built-in views located in 
    11091128
    11101129    Presents a form for entering a new password.
    11111130
     1131    **URL name:** ``password_reset_confirm``
     1132
    11121133    **Optional arguments:**
    11131134
    11141135        * ``uidb36``: The user's id encoded in base 36. Defaults to ``None``.
    includes a few other useful built-in views located in 
    11421163   Presents a view which informs the user that the password has been
    11431164   successfully changed.
    11441165
     1166   **URL name:** ``password_reset_complete``
     1167
    11451168   **Optional arguments:**
    11461169
    11471170       * ``template_name``: The full name of a template to display the view.
Back to Top