Created
January 3, 2013 23:14
-
-
Save whatisjasongoldstein/4448411 to your computer and use it in GitHub Desktop.
Static servering, pre-1.4 style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if 'runserver' in sys.argv: | |
from django.conf import settings | |
urlpatterns += patterns('', | |
(r'^media/(?P<path>.*)$', 'django.views.static.serve', | |
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), | |
(r'^static/(?P<path>.*)$', 'django.views.static.serve', | |
{'document_root': "%s/static/" % settings.PROJECT_ROOT, 'show_indexes': True}), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment