Hello there,
I just published an app on pythonanywhere, where you can post articles with an optional picture.
Whenever I submit the new_post form with a picture in it, I get an error 500, in logs I see for example:
FileNotFoundError: [Errno 2] No such file or directory: 'myapp/uploads/2020-10-07 15-21-54.115117.jpg'
The flask route which is responsible of uploading pictures is in /home/myself/myapp/myapp/routes.py
:
picture.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
And this UPLOAD_FOLDER
is set in /home/myself/myapp/config.py
Where am I wrong?? Is there any file permission that needs to be changed in order to write into the myapp/myapp/uploads
folder?
Thanks by advance. Benjamin