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?
Well I seem to have answered my own question. It was a very minor issue as it turns out. All I did was change the media root to the complete path and voila.
MEDIA_ROOT = 'Users/username/Desktop/myapp/media/'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments