环境:ubuntu
如果你使用了Apache部署了Django项目,在上传文件时可能会出现 “[Errno 13] Permission denied:某目录”的错误。
这是因为apache没有权限在该目录下生成文件夹和文件。
所以你需要做的只需要赋予Apache对该文件夹的权限就可以了。
执行command:chown www-data:www-data -R /your directory
www-data是Apache默认的用户组。
https://stackoverflow.com/questions/14798021/django-error-13-permission-denied
对于上传图片,必须在MEDIA_ROOT下面
Also, as asermax points out, make sure you have created an images directory within your MEDIA_ROOT.