Ticket #3185: 3185_docs.patch

File 3185_docs.patch, 2.8 KB (added by Marc Fargas <telenieko@…>, 17 years ago)

Documentation for this ticket.

  • docs/settings.txt

     
    166166        'news.Story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
    167167    }
    168168
     169ACCOUNT_URL
     170-------------
     171
     172Default: ``'/accounts/profile/'``
     173
     174The URL where requests are redirected after login when the ``"contrib.auth.login"`` view
     175gets no ``next`` parameter.
     176i.e.: When the `@login_required`_ decorator is called
     177
    169178ADMIN_FOR
    170179---------
    171180
     
    533542you'll have to remember to wrap the languages in the *real* ``gettext()`` in
    534543any code that uses ``LANGUAGES`` at runtime.
    535544
     545LOGIN_URL
     546-------------
     547
     548Default: ``'/accounts/login/'``
     549
     550The URL where requests are redirected for login, specially when using the
     551`@login_required`_ decorator.
     552
    536553MANAGERS
    537554--------
    538555
     
    967984
    968985It boils down to this: Use exactly one of either ``configure()`` or
    969986``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

     
    377377
    378378``login_required`` does the following:
    379379
    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:
    382383      ``/accounts/login/?next=/polls/3/``.
    383384    * If the user is logged in, execute the view normally. The view code is
    384385      free to assume the user is logged in.
    385386
    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::
     387Note that you'll need to map the appropriate Django view to ``"settings.LOGIN_URL"``.
     388For example, using the defaults, add the following line to your URLconf::
    388389
    389390    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
    390391
     
    395396
    396397    * If called via ``POST``, it tries to log the user in. If login is
    397398      successful, the view redirects to the URL specified in ``next``. If
    398       ``next`` isn't provided, it redirects to ``/accounts/profile/`` (which is
    399       currently hard-coded). If login isn't successful, it redisplays the login
     399      ``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
    400401      form.
    401402
    402403It's your responsibility to provide the login form in a template called
Back to Top