diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-09-14 01:24:36 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-09-14 01:24:36 +0000 |
| commit | f55f98f989ac0e4394d8ed0b2527bd1e5eda4149 (patch) | |
| tree | 1510aed36b18e19c7fab3f7421a0ff38c96e958b | |
| parent | adaf046591c087adb3ca31cd8ea901ed525918df (diff) | |
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
| -rw-r--r-- | django/conf/global_settings.py | 3 | ||||
| -rw-r--r-- | 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 8602cab229..c958e38863 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 25862da55a..d8403dc8a9 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 |
