mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
* Updated StaticFilesHandler and AdminMediaHandler to make use of the 404 handler if needed. * Updated runserver management command to serve static files only in DEBUG mode (or if specified the --insecure option) and if the staticfiles app is in INSTALLED_APPS. Also added an option to disable serving completely (--nostatic). * Added check in debug mode if STATICFILES_* settings are different to MEDIA_* settings. * Removed a faulty PendingDeprecationWarning in AdminMediaHandler that is triggered every time runserver is used. * Fixed an issue with the modification time checks when running collectstatic. * Extended and refined documentation. Thanks to everyone for input, especially to Carl Meyer, Ted Kaemming and Adam Vandenberg for patches. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -21,7 +21,7 @@ from django.contrib.staticfiles.views import \
|
||||
directory_index, was_modified_since, serve as staticfiles_serve
|
||||
|
||||
|
||||
def serve(request, path, document_root=None, show_indexes=False):
|
||||
def serve(request, path, document_root=None, show_indexes=False, insecure=False):
|
||||
"""
|
||||
Serve static files below a given point in the directory structure.
|
||||
|
||||
@@ -38,4 +38,4 @@ def serve(request, path, document_root=None, show_indexes=False):
|
||||
warnings.warn("The view at `django.views.static.serve` is deprecated; "
|
||||
"use the path `django.contrib.staticfiles.views.serve` "
|
||||
"instead.", PendingDeprecationWarning)
|
||||
return staticfiles_serve(request, path, document_root, show_indexes)
|
||||
return staticfiles_serve(request, path, document_root, show_indexes, insecure)
|
||||
|
||||
Reference in New Issue
Block a user