U
U
user-agent2020-05-30 10:05:56
Django
user-agent, 2020-05-30 10:05:56

Why doesn't it show media files?

When clicking on an image link, it gives a 404 error page.

urls.py

from django.conf.urls import url 
from django.conf import settings
from django.conf.urls.static import static
from django.views.defaults import server_error, page_not_found, permission_denied

urlpatterns = [
#urls
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT, show_indexes=True)

handler403 = curry(permission_denied, template_name='403.html')
handler404 = curry(page_not_found, template_name='404.html')
handler500 = curry(server_error, template_name='500.html')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-05-30
@user-agent

when DEBUG = False django runserver doesn't distribute static

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question