我部署了一个允许上传图像的Python Flask应用程序。图像目录位于我的app目录中并具有权限
drwxrwxrwx 2 ubuntu ubuntu 4096 Mar 28 23:22 images
当我提交图片时,我收到了以下错误:
[Wed Mar 28 23:49:29.896651 2018] [wsgi:error] [pid 14172:tid
140055544829696] [client ...] File "/usr/lib/python2.7/os.py", line
157, in makedirs, referer:
http://...compute.amazonaws.com/themes/Birds/paintings/new
[Wed Mar 28 23:49:29.896654 2018] [wsgi:error] [pid 14172:tid
140055544829696] [client ...] mkdir(name, mode), referer:
http://...compute.amazonaws.com/themes/Birds/paintings/new
[Wed Mar 28 23:49:29.896655 2018] [wsgi:error] [pid 14172:tid
140055544829696] [client ...] OSError: [Errno 13] Permission denied:
'images', referer:
http://...compute.amazonaws.com/themes/Birds/paintings/new
我是否需要为此配置其他功能?
答案 0 :(得分:0)
通过在app.py文件中设置此目录的完整路径来解决此问题。
app.config['UPLOADED_IMAGES_DEST'] = '/home/ubuntu/app/images'