I\'m trying to deploy a Flask app to Heroku. After deploying, application crashes and I get an error ModuleNotFoundError: No module named \'app\'.
Project structure
In my case, this was resolved after I made the following changes, of course committing the changes before pushing to heroku:
1) ran pip freeze > requirements.txt
,
2) moved my app.py
to a different directory, and updated Procfile
, manage.py
-all files importing app.py- and to reflect the new location. I'm not sure if moving the file actually made a difference, it seems unlikely, but regardless, it's worth verifying all files that import app
have the correct path