From f55f98f989ac0e4394d8ed0b2527bd1e5eda4149 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 14 Sep 2005 01:24:36 +0000 Subject: [PATCH] Fixed #500 -- Created a TEMPLATE_FILE_EXTENSION setting that lets you override the default '.html' if you want to use a different extension (or none at all) for templates git-svn-id: http://code.djangoproject.com/svn/django/trunk@640 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/conf/global_settings.py | 3 +++ django/core/template_file.py | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index 8602cab229a..c958e388638 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -51,6 +51,9 @@ EMAIL_HOST = 'localhost' # List of locations of the template source files, in search order. TEMPLATE_DIRS = () +# Extension on all templates. +TEMPLATE_FILE_EXTENSION = '.html' + # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". diff --git a/django/core/template_file.py b/django/core/template_file.py index 25862da55a2..d8403dc8a98 100644 --- a/django/core/template_file.py +++ b/django/core/template_file.py @@ -1,10 +1,8 @@ "Wrapper for loading templates from files" -from django.conf.settings import TEMPLATE_DIRS +from django.conf.settings import TEMPLATE_DIRS, TEMPLATE_FILE_EXTENSION from template import TemplateDoesNotExist import os -TEMPLATE_FILE_EXTENSION = '.html' - def load_template_source(template_name, template_dirs=None): if not template_dirs: template_dirs = TEMPLATE_DIRS