diff options
| author | James Bennett <ubernostrum@gmail.com> | 2008-12-04 19:34:23 +0000 |
|---|---|---|
| committer | James Bennett <ubernostrum@gmail.com> | 2008-12-04 19:34:23 +0000 |
| commit | c1ec41a91ab2ad03bed53f0e52f6bf88e707bc93 (patch) | |
| tree | a1e8addd33a81c8b3a21141bfa6233f29ae659b1 | |
| parent | c667fdd4d8dcdd83ccf56d352d17d479cdcbcfd5 (diff) | |
[1.0.X] Fixed #9754: static-serving view now uses correct template name for directory indexes. Was [9566] in trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/views/static.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/views/static.py b/django/views/static.py index 4ae4d8e60d..ca0f4f0a9a 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -28,7 +28,7 @@ def serve(request, path, document_root=None, show_indexes=False): also set ``show_indexes`` to ``True`` if you'd like to serve a basic index of the directory. This index view will use the template hardcoded below, but if you'd like to override it, you can create a template called - ``static/directory_index``. + ``static/directory_index.html``. """ # Clean up given path to only allow serving files below document_root. @@ -91,7 +91,8 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """ def directory_index(path, fullpath): try: - t = loader.get_template('static/directory_index') + t = loader.get_template('static/directory_index.html + ') except TemplateDoesNotExist: t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE, name='Default directory index template') files = [] |
