module documentation

Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting.

Function directory_index Undocumented
Function serve Serve static files below a given point in the directory structure.
Function was_modified_since Was something modified since the user last downloaded it?
Constant DEFAULT_DIRECTORY_INDEX_TEMPLATE Undocumented
Variable template_translatable Undocumented
def directory_index(path, fullpath): (source)

Undocumented

def serve(request, path, document_root=None, show_indexes=False): (source)

Serve static files below a given point in the directory structure. To use, put a URL pattern such as:: from django.views.static import serve path('<path:path>', serve, {'document_root': '/path/to/my/files/'}) in your URLconf. You must provide the ``document_root`` param. You may 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.html``.

def was_modified_since(header=None, mtime=0): (source)

Was something modified since the user last downloaded it? header This is the value of the If-Modified-Since header. If this is None, I'll just return True. mtime This is the modification time of the item we're talking about.

DEFAULT_DIRECTORY_INDEX_TEMPLATE: str = (source)

Undocumented

Value
'''
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en-us">
...
template_translatable = (source)

Undocumented