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
This commit is contained in:
Adrian Holovaty 2005-09-14 01:24:36 +00:00
parent adaf046591
commit f55f98f989
2 changed files with 4 additions and 3 deletions

View File

@ -51,6 +51,9 @@ EMAIL_HOST = 'localhost'
# List of locations of the template source files, in search order. # List of locations of the template source files, in search order.
TEMPLATE_DIRS = () TEMPLATE_DIRS = ()
# Extension on all templates.
TEMPLATE_FILE_EXTENSION = '.html'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash. # trailing slash.
# Examples: "http://foo.com/media/", "/media/". # Examples: "http://foo.com/media/", "/media/".

View File

@ -1,10 +1,8 @@
"Wrapper for loading templates from files" "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 from template import TemplateDoesNotExist
import os import os
TEMPLATE_FILE_EXTENSION = '.html'
def load_template_source(template_name, template_dirs=None): def load_template_source(template_name, template_dirs=None):
if not template_dirs: if not template_dirs:
template_dirs = TEMPLATE_DIRS template_dirs = TEMPLATE_DIRS