0
votes

I deployed a Python Flask app that allows to upload images. The directory for images is inside my app directory and has permissions

drwxrwxrwx 2 ubuntu   ubuntu    4096 Mar 28 23:22 images

When I submit an image, I get these errors:

[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

Do I need to configure something else for this to work?

1

1 Answers

0
votes

Solved it by setting a full path to this directory in my app.py file.

app.config['UPLOADED_IMAGES_DEST'] = '/home/ubuntu/app/images'