diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-03-31 23:34:03 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-03-31 23:34:03 +0000 |
| commit | 516051bfd2b537f441c46359cce7eacbf15fc4b8 (patch) | |
| tree | c518cb5727dcbbdeec08bf849e94bdfa7b5e36a7 /docs/topics/auth.txt | |
| parent | 15becf23a9e4c9b230745738d2d42f6ab8f0f031 (diff) | |
A whole lotta documentation fixes: Fixes #8704, #8826, #8980, #9243, #9343, #9529,
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/auth.txt')
| -rw-r--r-- | docs/topics/auth.txt | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt index c42388f393..15d0b39856 100644 --- a/docs/topics/auth.txt +++ b/docs/topics/auth.txt @@ -463,6 +463,12 @@ When a user profile model has been defined and specified in this manner, each instance of the user profile model associated with that :class:`~django.contrib.auth.models.User`. +The method :class:`~django.contrib.auth.models.User.get_profile()` +does not create the profile, if it does not exist. You need to +register a handler for the signal +:attr:`django.db.models.signals.post_save` on the User model, and, in +the handler, if created=True, create the associated user profile. + For more information, see `Chapter 12 of the Django book`_. .. _Chapter 12 of the Django book: http://www.djangobook.com/en/1.0/chapter12/#cn222 @@ -745,7 +751,7 @@ the following line to your URLconf:: <p>Your username and password didn't match. Please try again.</p> {% endif %} - <form method="post" action=""> + <form method="post" action="{% url django.contrib.auth.views.login %}"> <table> <tr> <td>{{ form.username.label_tag }}</td> @@ -868,6 +874,34 @@ includes a few other useful built-in views located in * ``login_url``: The URL of the login page to redirect to. This will default to :setting:`settings.LOGIN_URL <LOGIN_URL>` if not supplied. +.. function:: password_reset_confirm(request[,uidb36, token, template_name, token_generator, set_password_form, post_reset_redirect]) + + Presents a form for entering a new password. + + **Optional arguments:** + + * ``uidb36``: The user's id encoded in base 36. This will default to + ``None``. + * ``token``: Token to check that the password is valid. This will default to ``None``. + * ``template_name``: The full name of a template to display the confirm + password view. Default value is :file:`registration/password_reset_confirm.html`. + * ``token_generator``: Instance of the class to check the password. This + will default to ``default_token_generator``, it's an instance of + ``django.contrib.auth.tokens.PasswordResetTokenGenerator``. + * ``set_password_form``: Form that will use to set the password. This will + default to ``SetPasswordForm``. + * ``post_reset_redirect``: URL to redirect after the password reset + done. This will default to ``None``. + +.. function:: password_reset_complete(request[,template_name]) + + Presents a view that informs that the password has been changed very well. + + **Optional arguments:** + + * ``template_name``: The full name of a template to display the view. + This will default to :file:`registration/password_reset_complete.html`. + Built-in forms -------------- @@ -1125,10 +1159,10 @@ The currently logged-in user and his/her permissions are made available in the Users ----- -The currently logged-in user, either a -:class:`~django.contrib.auth.models.User` instance or an -:class:`~django.contrib.auth.models.AnonymousUser` instance, is stored in the -template variable ``{{ user }}``: +When rendering a template :class:`~django.template.context.RequestContext`, the +currently logged-in user, either a :class:`~django.contrib.auth.models.User` +instance or an :class:`~django.contrib.auth.models.AnonymousUser` instance, is +stored in the template variable ``{{ user }}``: .. code-block:: html @@ -1138,6 +1172,9 @@ template variable ``{{ user }}``: <p>Welcome, new user. Please log in.</p> {% endif %} +This template context variable is not available if a ``RequestContext`` is not +being used. + Permissions ----------- |
