Skip to content

Instantly share code, notes, and snippets.

@ghing
Created August 16, 2010 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghing/527656 to your computer and use it in GitHub Desktop.
Save ghing/527656 to your computer and use it in GitHub Desktop.
Sample Django urls.py that shows how to serve static content when running development server
from django.conf.urls.defaults import *
from django.contrib.gis import admin
import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^$', 'boystown.views.index'),
)
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment