Skip to content

Instantly share code, notes, and snippets.

@rasca
Created May 30, 2012 21:45
Show Gist options
  • Save rasca/2839142 to your computer and use it in GitHub Desktop.
Save rasca/2839142 to your computer and use it in GitHub Desktop.
Debug URLs
if settings.DEBUG:
urlpatterns = urlpatterns + patterns('',
(r'^404/$', TemplateView.as_view(template_name='404.html')),
(r'^500/$', TemplateView.as_view(template_name='500.html')),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.STATIC_ROOT,
}),
url(r'^media/(?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