From cbd0752740b4dfb054179f68ca330b8ac212ec77 Mon Sep 17 00:00:00 2001 From: Paul Oswald Date: Wed, 15 Feb 2012 10:30:56 +0900 Subject: [PATCH] Move the templates into a named directory --- djangorestframework/renderers.py | 6 +++--- .../templates/{ => djangorestframework}/api_login.html | 0 .../templates/{ => djangorestframework}/base_renderer.html | 0 .../templates/{ => djangorestframework}/renderer.html | 2 +- .../templates/{ => djangorestframework}/renderer.txt | 0 djangorestframework/utils/staticviews.py | 4 ++-- 6 files changed, 6 insertions(+), 6 deletions(-) rename djangorestframework/templates/{ => djangorestframework}/api_login.html (100%) rename djangorestframework/templates/{ => djangorestframework}/base_renderer.html (100%) rename djangorestframework/templates/{ => djangorestframework}/renderer.html (57%) rename djangorestframework/templates/{ => djangorestframework}/renderer.txt (100%) diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py index bb0f789aa..33c549fde 100644 --- a/djangorestframework/renderers.py +++ b/djangorestframework/renderers.py @@ -373,7 +373,7 @@ class DocumentingHTMLRenderer(DocumentingTemplateRenderer): media_type = 'text/html' format = 'html' - template = 'renderer.html' + template = 'djangorestframework/renderer.html' class DocumentingXHTMLRenderer(DocumentingTemplateRenderer): @@ -385,7 +385,7 @@ class DocumentingXHTMLRenderer(DocumentingTemplateRenderer): media_type = 'application/xhtml+xml' format = 'xhtml' - template = 'renderer.html' + template = 'djangorestframework/renderer.html' class DocumentingPlainTextRenderer(DocumentingTemplateRenderer): @@ -397,7 +397,7 @@ class DocumentingPlainTextRenderer(DocumentingTemplateRenderer): media_type = 'text/plain' format = 'txt' - template = 'renderer.txt' + template = 'djangorestframework/renderer.txt' DEFAULT_RENDERERS = ( diff --git a/djangorestframework/templates/api_login.html b/djangorestframework/templates/djangorestframework/api_login.html similarity index 100% rename from djangorestframework/templates/api_login.html rename to djangorestframework/templates/djangorestframework/api_login.html diff --git a/djangorestframework/templates/base_renderer.html b/djangorestframework/templates/djangorestframework/base_renderer.html similarity index 100% rename from djangorestframework/templates/base_renderer.html rename to djangorestframework/templates/djangorestframework/base_renderer.html diff --git a/djangorestframework/templates/renderer.html b/djangorestframework/templates/djangorestframework/renderer.html similarity index 57% rename from djangorestframework/templates/renderer.html rename to djangorestframework/templates/djangorestframework/renderer.html index adb42c7f2..01ca55435 100644 --- a/djangorestframework/templates/renderer.html +++ b/djangorestframework/templates/djangorestframework/renderer.html @@ -1,3 +1,3 @@ -{% extends "base_renderer.html" %} +{% extends "djangorestframework/base_renderer.html" %} {# Override this template in your own templates directory to customize #} \ No newline at end of file diff --git a/djangorestframework/templates/renderer.txt b/djangorestframework/templates/djangorestframework/renderer.txt similarity index 100% rename from djangorestframework/templates/renderer.txt rename to djangorestframework/templates/djangorestframework/renderer.txt diff --git a/djangorestframework/utils/staticviews.py b/djangorestframework/utils/staticviews.py index 9bae0ee78..caa63ccd3 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/api_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/api_login.html', redirect_field_name=REDIRECT_FIELD_NAME): return logout(request, next_page, template_name, redirect_field_name)