Kaydet (Commit) 8ae90c58 authored tarafından Anton Samarchyan's avatar Anton Samarchyan Kaydeden (comit) Tim Graham

Slightly simplified django.conf.urls.static.static().

üst c37ec5a6
......@@ -18,10 +18,10 @@ def static(prefix, view=serve, **kwargs):
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""
# No-op if not in debug mode or an non-local prefix
if not settings.DEBUG or (prefix and '://' in prefix):
return []
elif not prefix:
if not prefix:
raise ImproperlyConfigured("Empty static prefix not permitted")
elif not settings.DEBUG or '://' in prefix:
return []
return [
url(r'^%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), view, kwargs=kwargs),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment