我的服务器在Ubuntu上,使用了Apache+Nginx做App Server,Django+Python开发,今天上传文件时候出现了OSError的错误,具体原因为Permission denied
一看发现是因为上传文件的文件夹可能没有被赋予www-data用户(Apache和Nginx用户)写的权限
根据以下网站的解决办法已经解决问题了,特写此博希望能帮到大家
I just ran into this same problem. And found the solution if you are hosting with Apache as your server. For instance if my settings were:
MEDIA_ROOT = '/var/www/media/geekingreen'
then I would simply need to give that folder the correct permissions recursively to make sure that any sub-folders also have the same permission. The default group for apache is www-data so to give permission to my django app I would run these commands.
366



被折叠的 条评论
为什么被折叠?



