1
The MEDIA_ROOT
setting [Django-doc] specifies the:
Absolute filesystem path to the directory that will hold user-uploaded files.
You thus should specify with this setting where you will store the media files. If MEDIA_ROOT
is thus /
, then it will store these in the /_mat/
directory of the server.
You thus can set the MEDIA_ROOT
setting to:
# settings.py
# โฎ,
MEDIA_ROOT = '/var/www/html/myproj/'
# โฎ
0
permission denied i think come from ubuntu file system it self
so you can run
sudo chmod -R 755 /var/www/html/myproj/_mat/
and it is better also to make user of Nginx is same as gunicorn and give this user access to your media
as follow let your user is user1
sudo chown -R user1:user1 /var/www/html/myproj/_mat/
- [Answered ]-Remove %20 from urls
- [Answered ]-Django testing a form, self.request kwargs gives keyerror
- [Answered ]-Django: how to cache dynamic pages flexibly?
- [Answered ]-Downloading a file from Django template on click doesn't work
Source:stackexchange.com