Skip to content

Instantly share code, notes, and snippets.

@pygeek
Created April 1, 2013 19:13
Show Gist options
  • Save pygeek/5286978 to your computer and use it in GitHub Desktop.
Save pygeek/5286978 to your computer and use it in GitHub Desktop.
Django serves static files on debug mode
if settings.DEBUG:
urlpatterns += patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.STATIC_ROOT,
}),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
}),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment