From b2d9c801f804c2964efeba952b9ac7389971906c Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 5 Oct 2009 21:20:21 -0400 Subject: serve up static media when developing --- bn_django/urls.py.example | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bn_django/urls.py.example') diff --git a/bn_django/urls.py.example b/bn_django/urls.py.example index c175624..dbb5f6f 100644 --- a/bn_django/urls.py.example +++ b/bn_django/urls.py.example @@ -1,3 +1,4 @@ +from django.conf import settings from django.conf.urls.defaults import * from photos.models import Photo from django.contrib.comments.models import Comment @@ -54,3 +55,8 @@ urlpatterns = patterns('', #(r'^media/(?P.*)$', 'django.views.static.serve', # {'document_root': '/home/bnewbold/code/bn-project/media'}), ) + +if settings.DEBUG: + urlpatterns += patterns('', + (r'^static/(?P.*)$', 'django.views.static.serve', + {'document_root': '/path/to/media'}), ) -- cgit v1.2.3