Question:
I’m having issue with hosting Flask App on AWS with Elastic Beanstalk.
I followed document on AWS(which seems a little old?), and did some workaround suggested here. It works if I have this folder structure:
1 2 3 4 5 6 |
--application.py /static /templates requirements.txt .ebextensions .elasticbeanstalk |
However, I want to make my application more structured. So I moved my folder structure to and it stopped working
1 2 3 4 5 6 7 |
--application.py --.ebxtensions --.elasticbeanstalk /app - __init__.py - /static - /templates |
What I have tried is changing the settings in optionsettings.myapp-env, suggested here. But I got no luck.
(P.S. App works fine except not recognizing the static files folder)
Any help would be appreciated!
Answer:
Looks like you need to change the path mapping to:
“/static/”: “app/static/”
This mapping maps the virtual (what you refer in your html) to the directory structure. Since you have changed the dirs, now you need to change the mapping too.
Alternatively you can do the same conf in the AWS Beanstalk web console as well. Need not do in the configuration files.