aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/templates
diff options
context:
space:
mode:
authorTom Christie2012-09-07 10:20:25 +0100
committerTom Christie2012-09-07 10:20:25 +0100
commitf1dc9be5fcbb8f89c4e2929ddee835ef251c8e71 (patch)
tree313992349f834f3d279b7ada9884b35562cf0e7d /djangorestframework/templates
parent215de9af81007e81def7ee9f9590e0c12dfec272 (diff)
downloaddjango-rest-framework-f1dc9be5fcbb8f89c4e2929ddee835ef251c8e71.tar.bz2
Optional login/logout tags so browseable API will work without requiring auth views
Diffstat (limited to 'djangorestframework/templates')
-rw-r--r--djangorestframework/templates/djangorestframework/base.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/djangorestframework/templates/djangorestframework/base.html b/djangorestframework/templates/djangorestframework/base.html
index a4988d1d..7a3e71eb 100644
--- a/djangorestframework/templates/djangorestframework/base.html
+++ b/djangorestframework/templates/djangorestframework/base.html
@@ -4,6 +4,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load urlize_quoted_links %}
{% load add_query_param %}
+{% load optional_login %}
{% load static %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@@ -24,10 +25,9 @@
{% block userlinks %}
{% if user.is_active %}
Welcome, {{ user }}.
- <a href='{% url 'djangorestframework:logout' %}?next={{ request.path }}'>Log out</a>
+ {% optional_login %}
{% else %}
- Anonymous
- <a href='{% url 'djangorestframework:login' %}?next={{ request.path }}'>Log in</a>
+ {% optional_logout %}
{% endif %}
{% endblock %}
</div>