Ticket #3185: 3185_docs.patch
File 3185_docs.patch, 2.8 KB (added by , 18 years ago) |
---|
-
docs/settings.txt
166 166 'news.Story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug), 167 167 } 168 168 169 ACCOUNT_URL 170 ------------- 171 172 Default: ``'/accounts/profile/'`` 173 174 The URL where requests are redirected after login when the ``"contrib.auth.login"`` view 175 gets no ``next`` parameter. 176 i.e.: When the `@login_required`_ decorator is called 177 169 178 ADMIN_FOR 170 179 --------- 171 180 … … 533 542 you'll have to remember to wrap the languages in the *real* ``gettext()`` in 534 543 any code that uses ``LANGUAGES`` at runtime. 535 544 545 LOGIN_URL 546 ------------- 547 548 Default: ``'/accounts/login/'`` 549 550 The URL where requests are redirected for login, specially when using the 551 `@login_required`_ decorator. 552 536 553 MANAGERS 537 554 -------- 538 555 … … 967 984 968 985 It boils down to this: Use exactly one of either ``configure()`` or 969 986 ``DJANGO_SETTINGS_MODULE``. Not both, and not neither. 987 988 .. _@login_required: http://www.djangoproject.com/documentation/authentication/#the-login-required-decorator -
docs/authentication.txt
377 377 378 378 ``login_required`` does the following: 379 379 380 * If the user isn't logged in, redirect to ``/accounts/login/``, passing 381 the current absolute URL in the query string as ``next``. For example: 380 * If the user isn't logged in, redirect to ``"settings.LOGIN_URL"`` 381 (``"/accounts/login/"`` by default), passing the current absolute URL 382 in the query string as ``next``. For example: 382 383 ``/accounts/login/?next=/polls/3/``. 383 384 * If the user is logged in, execute the view normally. The view code is 384 385 free to assume the user is logged in. 385 386 386 Note that you'll need to map the appropriate Django view to `` /accounts/login/``.387 To do this, add the following line to your URLconf::387 Note that you'll need to map the appropriate Django view to ``"settings.LOGIN_URL"``. 388 For example, using the defaults, add the following line to your URLconf:: 388 389 389 390 (r'^accounts/login/$', 'django.contrib.auth.views.login'), 390 391 … … 395 396 396 397 * If called via ``POST``, it tries to log the user in. If login is 397 398 successful, the view redirects to the URL specified in ``next``. If 398 ``next`` isn't provided, it redirects to `` /accounts/profile/`` (which is399 currently hard-coded). If login isn't successful, it redisplays the login399 ``next`` isn't provided, it redirects to ``"settings.ACCOUNT_URL"`` which 400 defaults to ``/accounts/profile/``. If login isn't successful, it redisplays the login 400 401 form. 401 402 402 403 It's your responsibility to provide the login form in a template called