Skip to content

Instantly share code, notes, and snippets.

@GeorgeErickson
Created August 28, 2012 14:52
Show Gist options
  • Save GeorgeErickson/3498709 to your computer and use it in GitHub Desktop.
Save GeorgeErickson/3498709 to your computer and use it in GitHub Desktop.
Serving static files in django for development
from django.conf import settings
from django.conf.urls.defaults import patterns, url
import os
urlpatterns = patterns('',)
if settings.DEBUG:
urlpatterns += patterns('',
url(r'^(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.getcwd()})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment