Hosted on AWS Elastic Bean(EB): http://flask-env2.us-east-2.elasticbeanstalk.com/
Steps to host on EB:
-
download and install EB CLI
-
generate list of dependencies from the Python environment:
pip freeze > REQUIREMENTS.txt
Remove line referencing git repository and pkg-resources==0.0.0
if present.
- create .ebignore file and add ignore relevant directories/files
In the tutorial by default, the application factory, create_app(), imports db.py, blog.py, and auth.py by using relative imports:
from . import db
and refers to the modules by their name.
This will not work on EB. Solution:
import flaskr.db
flaskr is the package, as dictated by the presence of init.py, and db is a module within that package.
You must then refer to db as flaskr.db
.