Skip to content

Commit

Permalink
Allow static files in development
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwright committed Nov 14, 2008
1 parent 19eea3c commit 9491ca7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions yoursite/urls.py
@@ -1,4 +1,6 @@
import os
from django.conf.urls.defaults import *
from django.conf import settings

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
Expand All @@ -15,3 +17,15 @@
# Uncomment the next line to enable the admin:
# (r'^admin/(.*)', admin.site.root),
)

# this is for serving static files in development
if settings.DEBUG:
urlpatterns += patterns('',
(
r'^static/(?P<path>.*)$',
'django.views.static.serve',
{
'document_root': os.path.join(os.path.dirname(__file__), '../static')
}
),
)

0 comments on commit 9491ca7

Please sign in to comment.