Created
May 18, 2018 15:10
-
-
Save andreif/a2f49f8bc19edcf813a6f36c1766bf7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if settings.DEBUG: | |
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | |
elif settings.IS_LOCAL: # for testing with DEBUG=False | |
urlpatterns += patterns('', | |
(r'^%s(?P<path>.*)$' % re.escape(settings.STATIC_URL.lstrip('/')), | |
'django.contrib.staticfiles.views.serve', {'insecure': True}), | |
(r'^%s(?P<path>.*)$' % re.escape(settings.MEDIA_URL.lstrip('/')), | |
'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