Skip to content

Instantly share code, notes, and snippets.

@kissgyorgy
Created November 27, 2013 18:20
Show Gist options
  • Save kissgyorgy/7680560 to your computer and use it in GitHub Desktop.
Save kissgyorgy/7680560 to your computer and use it in GitHub Desktop.
Python: Serve django media in development mode
# http://stackoverflow.com/a/5518073/720077
from django.conf import settings
# ... your normal urlpatterns here
if settings.DEBUG:
# static files (images, css, javascript, etc.)
urlpatterns += patterns('',
(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