1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Made template names in django.contrib.auth.views passable as template_name argument to the view

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2006-06-06 05:16:05 +00:00
parent afe55af1e7
commit 6dfea737f6
2 changed files with 21 additions and 14 deletions

View File

@@ -347,8 +347,8 @@ Here's what ``django.contrib.auth.views.login`` does::
form.
It's your responsibility to provide the login form in a template called
``registration/login.html``. This template gets passed three template context
variables:
``registration/login.html`` by default. This template gets passed three
template context variables:
* ``form``: A ``FormWrapper`` object representing the login form. See the
`forms documentation`_ for more on ``FormWrapper`` objects.
@@ -357,6 +357,13 @@ variables:
* ``site_name``: The name of the current ``Site``, according to the
``SITE_ID`` setting. See the `site framework docs`_.
If you'd prefer not to call the template ``registration/login.html``, you can
pass the ``template_name`` parameter via the extra arguments to the view in
your URLconf. For example, this URLconf line would use ``myapp/login.html``
instead::
(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}),
Here's a sample ``registration/login.html`` template you can use as a starting
point. It assumes you have a ``base.html`` template that defines a ``content``
block::