+
+if settings.DEBUG:
+ import debug_toolbar
+ urlpatterns = [
+ url(r'^__debug__/', include(debug_toolbar.urls)),
+ ] + urlpatterns
+
+if settings.DEBUG:
+ urlpatterns += [
+ # Static files
+ url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], django.views.static.serve,
+ {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
+ url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], django.views.static.serve,
+ {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
+ ]