Ticket #10272: 10272-document-signatures-parameters-r10680.diff
File 10272-document-signatures-parameters-r10680.diff, 6.7 KB (added by , 16 years ago) |
---|
-
docs/topics/auth.txt
697 697 698 698 (r'^accounts/login/$', 'django.contrib.auth.views.login'), 699 699 700 .. function:: views.login( )700 .. function:: views.login(request, [template_name, redirect_field_name]) 701 701 702 702 Here's what ``django.contrib.auth.views.login`` does: 703 703 … … 712 712 redisplays the login form. 713 713 714 714 It's your responsibility to provide the login form in a template called 715 ``registration/login.html`` by default. This template gets passed three715 ``registration/login.html`` by default. This template gets passed four 716 716 template context variables: 717 717 718 718 * ``form``: A :class:`~django.forms.Form` object representing the login … … 721 721 722 722 * ``next``: The URL to redirect to after successful login. This may 723 723 contain a query string, too. 724 725 * ``site``: The current :class:`~django.contrib.sites.models.Site`, 726 according to the :setting:`SITE_ID` setting. If you're using the 727 Django development version and you don't have the site framework 728 installed, this will be set to an instance of 729 :class:`~django.contrib.sites.models.RequestSite`, which derives the 730 site name and domain from the current :class:`~django.http.HttpRequest`. 731 732 * ``site_name``: An alias for ``site.name``. If you're using the 733 Django development version and you don't have the site framework 734 installed, this will be set to the value of 735 :attr:`request.META['SERVER_NAME'] <django.http.HttpRequest.META>`. 736 For more on sites, see :ref:`ref-contrib-sites`. 724 737 725 * ``site_name``: The name of the current726 :class:`~django.contrib.sites.models.Site`, according to the727 :setting:`SITE_ID` setting. If you're using the Django development728 version and you don't have the site framework installed, this will be729 set to the value of :attr:`request.META['SERVER_NAME']730 <django.http.HttpRequest.META>`. For more on sites, see731 :ref:`ref-contrib-sites`.732 733 738 If you'd prefer not to call the template :file:`registration/login.html`, 734 739 you can pass the ``template_name`` parameter via the extra arguments to 735 740 the view in your URLconf. For example, this URLconf line would use 736 741 :file:`myapp/login.html` instead:: 737 742 738 743 (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}), 739 744 745 You can also specify the name of the ``GET`` field which contains the URL 746 to redirect to after login by passing ``redirect_field_name`` to the view. 747 By default, the field is called ``next``. 748 740 749 Here's a sample :file:`registration/login.html` template you can use as a 741 750 starting point. It assumes you have a :file:`base.html` template that 742 751 defines a ``content`` block: … … 818 827 displaying the password change form. This will default to 819 828 :file:`registration/password_change_form.html` if not supplied. 820 829 821 * ``post_change_redirect``: The URL to redirect to after successful830 * ``post_change_redirect``: The URL to redirect to after a successful 822 831 password change. 823 832 824 833 **Template context:** … … 835 844 default to :file:`registration/password_change_done.html` if not 836 845 supplied. 837 846 838 .. function:: views.password_reset 847 .. function:: views.password_reset(request[, is_admin_site, template_name, email_template_name, password_reset_form, token_generator, post_reset_redirect]) 839 848 840 849 Allows a user to reset their password, and sends them the new password 841 850 in an e-mail. … … 849 858 * ``email_template_name``: The full name of a template to use for 850 859 generating the e-mail with the new password. This will default to 851 860 :file:`registration/password_reset_email.html` if not supplied. 852 861 862 * ``password_reset_form``: Form that will be used to set the password. 863 Defaults to ``SetPasswordForm``. 864 865 * ``token_generator``: Instance of the class to check the password. This 866 will default to ``default_token_generator``, it's an instance of 867 ``django.contrib.auth.tokens.PasswordResetTokenGenerator``. 868 869 * ``post_reset_redirect``: The URL to redirect to after a successful 870 password change. 871 853 872 **Template context:** 854 873 855 874 * ``form``: The form for resetting the user's password. 856 875 857 .. function:: views.password_reset_done 876 .. function:: views.password_reset_done(request[, template_name]) 858 877 859 878 The page shown after a user has reset their password. 860 879 … … 864 883 default to :file:`registration/password_reset_done.html` if not 865 884 supplied. 866 885 867 .. function:: views.redirect_to_login 886 .. function:: views.redirect_to_login(next[, login_url, redirect_field_name]) 868 887 869 888 Redirects to the login page, and then back to another URL after a 870 889 successful login. … … 877 896 878 897 * ``login_url``: The URL of the login page to redirect to. This will 879 898 default to :setting:`settings.LOGIN_URL <LOGIN_URL>` if not supplied. 899 900 * ``redirect_field_name``: The name of a ``GET`` field containing the 901 URL to redirect to after log out. Overrides ``next`` if the given 902 ``GET`` parameter is passed. 903 904 .. function:: password_reset_confirm(request[, uidb36, token, template_name, token_generator, set_password_form, post_reset_redirect]) 880 905 881 .. function:: password_reset_confirm(request[,uidb36, token, template_name, token_generator, set_password_form, post_reset_redirect])882 883 906 Presents a form for entering a new password. 884 907 885 908 **Optional arguments:** … … 892 915 * ``token_generator``: Instance of the class to check the password. This 893 916 will default to ``default_token_generator``, it's an instance of 894 917 ``django.contrib.auth.tokens.PasswordResetTokenGenerator``. 895 * ``set_password_form``: Form that will use to set the password. This will896 default to ``SetPasswordForm``.918 * ``set_password_form``: Form that will be used to set the password. 919 This will default to ``SetPasswordForm``. 897 920 * ``post_reset_redirect``: URL to redirect after the password reset 898 921 done. This will default to ``None``. 899 922 900 923 .. function:: password_reset_complete(request[,template_name]) 901 924 902 Presents a view that informs that the password has been changed very well. 925 Presents a view which informs the user that the password has been 926 successfully changed. 903 927 904 928 **Optional arguments:** 905 929