{% if user.is_active %}Welcome, {{ user }}.{% if logout_url %} Log out{% endif %}{% else %}Anonymous {% if login_url %}Log in{% endif %}{% endif %}
+ {% block userlinks %}{% endblock %}
+ {% block nav-global %}{% endblock %}
+ {% block breadcrumbs %}
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{{ breadcrumb_name }} {% if not forloop.last %}›{% endif %}
{% endfor %}
+ {% endblock %}
+
{% if 'OPTIONS' in view.allowed_methods %}
@@ -123,7 +131,12 @@
{% endif %}
+
+
+
+
+ {% block footer %}{% endblock %}
diff --git a/djangorestframework/templates/api_login.html b/djangorestframework/templates/djangorestframework/login.html
similarity index 100%
rename from djangorestframework/templates/api_login.html
rename to djangorestframework/templates/djangorestframework/login.html
diff --git a/djangorestframework/utils/staticviews.py b/djangorestframework/utils/staticviews.py
index 9bae0ee78..7cbc0b9b8 100644
--- a/djangorestframework/utils/staticviews.py
+++ b/djangorestframework/utils/staticviews.py
@@ -12,7 +12,7 @@ import base64
# be making settings changes in order to accomodate django-rest-framework
@csrf_protect
@never_cache
-def api_login(request, template_name='api_login.html',
+def api_login(request, template_name='djangorestframework/login.html',
redirect_field_name=REDIRECT_FIELD_NAME,
authentication_form=AuthenticationForm):
"""Displays the login form and handles the login action."""
@@ -57,5 +57,5 @@ def api_login(request, template_name='api_login.html',
}, context_instance=RequestContext(request))
-def api_logout(request, next_page=None, template_name='api_login.html', redirect_field_name=REDIRECT_FIELD_NAME):
+def api_logout(request, next_page=None, template_name='djangorestframework/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
return logout(request, next_page, template_name, redirect_field_name)
diff --git a/docs/howto/setup.rst b/docs/howto/setup.rst
index 22f98f0c6..64b58262c 100644
--- a/docs/howto/setup.rst
+++ b/docs/howto/setup.rst
@@ -29,6 +29,19 @@ but once you move onto a production server, you'll want to make sure you serve t
* Ensure that the ``ADMIN_MEDIA_PREFIX`` is set appropriately and that you are serving the admin media.
(Django's testserver will automatically serve the admin media for you)
+You may customize the templates by creating a new template called ``djangorestframework/api.html``
+in your project, extend ``djangorestframework/base.html`` and override the
+appropriate ``{% block tags %}``. For example::
+
+ {% extends "djangorestframework/base.html" %}
+
+ {% block title %}My API{% endblock %}
+
+ {% block branding %}
+