~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to django/views/static.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-07-29 11:26:28 UTC
  • mfrom: (1.1.8 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090729112628-pg09ino8sz0sj21t
Tags: 1.1-1
* New upstream release.
* Merge from experimental:
  - Ship FastCGI initscript and /etc/default file in python-django's examples
    directory (Closes: #538863)
  - Drop "05_10539-sphinx06-compatibility.diff"; it has been applied
    upstream.
  - Bump Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    also set ``show_indexes`` to ``True`` if you'd like to serve a basic index
29
29
    of the directory.  This index view will use the template hardcoded below,
30
30
    but if you'd like to override it, you can create a template called
31
 
    ``static/directory_index``.
 
31
    ``static/directory_index.html``.
32
32
    """
33
33
 
34
34
    # Clean up given path to only allow serving files below document_root.
91
91
 
92
92
def directory_index(path, fullpath):
93
93
    try:
94
 
        t = loader.get_template('static/directory_index')
 
94
        t = loader.select_template(['static/directory_index.html',
 
95
                'static/directory_index'])
95
96
    except TemplateDoesNotExist:
96
97
        t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE, name='Default directory index template')
97
98
    files = []