1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixes #15270 -- Moved back the serve view to django.views.static due to dependency conflicts with the contrib app staticfiles (reverts parts of r14293). Added a helper function that generates URL patterns for serving static and media files during development. Thanks to Carl for reviewing the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-02-14 01:42:26 +00:00
parent 6b1191b1a2
commit a26034ffbf
8 changed files with 223 additions and 211 deletions

View File

@@ -18,8 +18,9 @@ import warnings
from django.core.management.color import color_style
from django.utils.http import http_date
from django.utils._os import safe_join
from django.views import static
from django.contrib.staticfiles import handlers, views as static
from django.contrib.staticfiles import handlers
__version__ = "0.1"
__all__ = ['WSGIServer','WSGIRequestHandler']
@@ -677,8 +678,7 @@ class AdminMediaHandler(handlers.StaticFilesHandler):
def serve(self, request):
document_root, path = os.path.split(self.file_path(request.path))
return static.serve(request, path,
document_root=document_root, insecure=True)
return static.serve(request, path, document_root=document_root)
def _should_handle(self, path):
"""