* Give the login and logout views a name and refer to the logout view by that name.
authorMatthijs Kooijman <matthijs@stdin.nl>
Sun, 3 Feb 2008 18:25:18 +0000 (19:25 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sun, 3 Feb 2008 18:25:18 +0000 (19:25 +0100)
templates/base/base.html
urls.py

index 4a35e870d7e07a281466f86d25f06ae012c5a1a9..8fefc9a32e661ac8533285c676859885cf880fd6 100644 (file)
@@ -21,7 +21,7 @@
 <div class="Footer">
 {% if user.is_authenticated %}
        <p>{% blocktrans with user.username as username %}You are currently logged in as {{ username }}{% endblocktrans %} 
-       -- <a href="../logout/">{% trans "Logout" %}</a></p>
+       -- <a href="{% url logout %}">{% trans "Logout" %}</a></p>
 {% endif %}
 </div>
 
diff --git a/urls.py b/urls.py
index 0483644b193f55511fe3dd60c2c8b81ab331f824..bffdb4fba5826badd0918351cddc703a8cd09252 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -25,8 +25,8 @@ urlpatterns = patterns('',
     url(r'^influences/character/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', chars_dict, name='influences_character_detail'),
     url(r'^influences/character/add/$', 'ee.influences.views.addCharacter', name='influences_add_character'),
 
-    url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}),
-    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'),
+    url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}, name='login'),
+    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login', name='logout'),
 )
 
 if settings.DEBUG: