Answer the question
In order to leave comments, you need to log in
Forbidden access for django apache2 media files, what's the problem?
There is a jungi admin panel running on ubuntu via apache with mod_wsgi. You can save files in the admin panel, and they are saved without problems. But when I try to open the saved file I get:
Forbidden
You don't have permission to access /media/file.pdf on this server.
STATIC_URL = '/static/'
STATIC_ROOT = '/full/path/to/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Alias /static/ "/static/folder/"
Alias /media/ "/meida/folder/"
<Directory "/static/folder">
Require all granted
</Directory>
<Directory "/media/folder">
Require all granted
</Directory>
client denied by server configuration: /etc/apache2/home
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question