I've looked at all the other solutions but nothing seems to work for me. I have this in my settings.
MEDIA_ROOT = '/Desktop/myapp/media/'
MEDIA_URL = 'http://127.0.0.1:8000/media/'
This in my admin.py
image = models.FileField(upload_to='images/')
I am running this on the localhost server at the moment. When I try to upload an image in admin and save it, I get the error:
[Errno 13] Permission denied: '/Desktop'
I've tried changing the mode using chmod
and chown
, but I still get the same error. I have even checked lsof -i and Python does seem to have access to this folder. What am I doing wrong?