Skip to content

Conversation

@AlexTsai1618
Copy link

@AlexTsai1618 AlexTsai1618 commented Dec 10, 2020

According to the document django version >= 1.7
which is not support the following URL configuration

 url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
                  {'document_root': settings.MEDIA_ROOT}),

so I fix it to
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
at the end of url configuration
and also the require library.
from django.conf.urls.static import static

According to the document django version >= 1.7 
which is not support the fallowing URL configuration
 url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
                  {'document_root': settings.MEDIA_ROOT}),
so I fix it to + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) at the end of urlpatterns and import the static library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant