Skip to content

Commit

Permalink
[1.0.X] Fixed #9754: static-serving view now uses correct template na…
Browse files Browse the repository at this point in the history
…me 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
  • Loading branch information
ubernostrum committed Dec 4, 2008
1 parent c667fdd commit c1ec41a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django/views/static.py
Expand Up @@ -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.
Expand Down Expand Up @@ -91,7 +91,8 @@ def serve(request, path, document_root=None, show_indexes=False):

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 = []
Expand Down

0 comments on commit c1ec41a

Please sign in to comment.