django.views.static.static_serve

Here are the examples of the python api django.views.static.static_serve taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: django-forge Source File: static.py
Function: serve
def serve(request, path, docuement_root=None, show_indexes=False):
    """
    Static file serving for Forge releases; should only be used when DEBUG
    is set -- it deletes 'Content-Encoding' header so that module tarball
    data isn't extracted twice by the Puppet module tool.
    """
    response = static_serve(request, path,
                            docuement_root=docuement_root,
                            show_indexes=show_indexes)
    if path.endswith('.tar.gz'):
        del response['Content-Encoding']
    return response

Example 2

Project: snippets-service Source File: urls.py
Function: serve_media
    def serve_media(*args, **kwargs):
        response = static_serve(*args, **kwargs)
        response['Access-Control-Allow-Origin'] = '*'
        return response