404 error while loading uploaded image when debug is False

253 views
Skip to first unread message

mayank dubey

unread,
Mar 21, 2019, 2:05:21 PM3/21/19
to django...@googlegroups.com
Hii there,

I am not able to load images which have been uploaded through the admin portal on my Django site if I set debug = false. While when debug = true, images are easily loaded. I am not able to understand what is the problem, please help me out.

Thank you,
M

Mohammad Etemaddar

unread,
Mar 21, 2019, 4:36:24 PM3/21/19
to django...@googlegroups.com
In production , we serve static files (like images) stright from httpd like apache, and we do not call django to serve them.
But in testing while run django test server, we use static paths in urls.py to serve them,

Maybe you have added mediaurls to your urlpatterns in urls.py conditionally (when settings.debug == True) so they are not added when debug is False.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMJ6Xs6qROL597vvX53%3DSpLqagovcMcz_wROFp828zm%3DrYE8DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages