This is a cross post from this question on SO. I am trying to open and write to a file from a view in django using f = open(os.path.join(settings.MEDIA_URL, 'file.txt'), 'w'). I am able to able to open and write to the file from manage.py shell but when running on webfaction the command above gives the error "[Errno 13] Permission denied: '/media/file.txt'". Because I am able to access the file from the python shell I was thinking it might be an issue with the WSGI script or the apache settings on webfaction. Any suggestions? asked 07 Nov '11, 16:28 DanielN |
Are you maybe wanting to use MEDIA_ROOT instead of MEDIA_URL? answered 07 Nov '11, 16:54 bmeyer71 ♦♦ |