PageRenderTime 45ms CodeModel.GetById 41ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/django/contrib/staticfiles/urls.py

https://code.google.com/p/mango-py/
Python | 16 lines | 9 code | 3 blank | 4 comment | 4 complexity | 4ffba2bbf45c8ea5e312a73c59bdf95e MD5 | raw file
 1from django.conf import settings
 2from django.conf.urls.static import static
 3
 4urlpatterns = []
 5
 6def staticfiles_urlpatterns(prefix=None):
 7    """
 8    Helper function to return a URL pattern for serving static files.
 9    """
10    if prefix is None:
11        prefix = settings.STATIC_URL
12    return static(prefix, view='django.contrib.staticfiles.views.serve')
13
14# Only append if urlpatterns are empty
15if settings.DEBUG and not urlpatterns:
16    urlpatterns += staticfiles_urlpatterns()