[Django]-Errno 13 Permission denied Django Upload File

7👍

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/'

10👍

I just had the same problem with the absolute path, but I realised something else. I was joining the path like this:

os.path.join(BASE_DIR, "/media")

But, as stated by the documentation:

If a component is an absolute path, all previous components are thrown
away and joining continues from the absolute path component.

So removing the root slash solves the problem:

os.path.join(BASE_DIR, "media")

Cheers.

Leave a comment