Skip to content

Instantly share code, notes, and snippets.

@danielstocks
Created May 5, 2010 14:04
Show Gist options
  • Save danielstocks/390811 to your computer and use it in GitHub Desktop.
Save danielstocks/390811 to your computer and use it in GitHub Desktop.
Serving static media with the Django development server
if settings.DEBUG:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
(r'(.*\.html)$', 'django.views.generic.simple.direct_to_template'),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment