From 6dfea737f627cb8c06b8feac0905136c3e55bae6 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 6 Jun 2006 05:16:05 +0000 Subject: 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 --- docs/authentication.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/authentication.txt b/docs/authentication.txt index 804f0326c1..79a4ed0875 100644 --- a/docs/authentication.txt +++ b/docs/authentication.txt @@ -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:: -- cgit v1.3