diff --git a/yoursite/urls.py b/yoursite/urls.py index 11507e1..96ab742 100644 --- a/yoursite/urls.py +++ b/yoursite/urls.py @@ -20,12 +20,17 @@ # this is for serving static files in development if settings.DEBUG: + import os + # get the static path from settings + static_url = settings.MEDIA_URL + if static_url.startswith('/'): + static_url = static_url.lstrip('/') urlpatterns += patterns('', ( - r'^static/(?P.*)$', + r'^%s(?P.*)$' % static_url, 'django.views.static.serve', { - 'document_root': os.path.join(os.path.dirname(__file__), '../static') + 'document_root': settings.MEDIA_ROOT } ), ) \ No newline at end of file