summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-01-09 12:42:35 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-01-09 12:42:35 +0000
commit37260e046f438e4eb871b6b84cafbf4fcd4b92ea (patch)
tree05a1b575b2be3e4e4128b86bcadd27d757722fd7 /django
parent195a6ea7913fe436f30558ea0913a5ebe147b394 (diff)
[1.0.X] Revised r9567 slightly to be backwards compatible with versions 1.0 - 1.0.2.
Also documented the change. We prefer to load directory_index.html for static directory listings, but if you have the (older style) "directory_index" template and no .html version, we'll load that. This should stop a bunch of mysterious breakages when people upgrade to Django 1.0.3 or Django 1.1. Also keeps the docs in sync with released code. Fixed #9993. Backport of r9725 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/views/static.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/views/static.py b/django/views/static.py
index c8ebf0c22d..8355950fe0 100644
--- a/django/views/static.py
+++ b/django/views/static.py
@@ -91,7 +91,8 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """
def directory_index(path, fullpath):
try:
- t = loader.get_template('static/directory_index.html')
+ t = loader.select_template(['static/directory_index.html',
+ 'static/directory_index'])
except TemplateDoesNotExist:
t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE, name='Default directory index template')
files = []