Answer the question
In order to leave comments, you need to log in
Why won't the file open?
On the site, when going to the document /media/uploads/2016/Buh_2015.pdf, it
gives a 403 error. The site is made with django. I can't say more, because I don't know anything else myself. Tell me, is it because of django or is it something server-side (well, that is, related to ngnix)?
Answer the question
In order to leave comments, you need to log in
There are several nuances.
Are MEDIA_URL and MEDIA_ROOT specified in serttings.py?
Are you running locally or not?
If locally, then django itself cannot serve media files, you need to add to urls.py
from django.conf import settings
from django.conf.urls.static import static
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question