Flask and Heroku - ModuleNotFoundError: No module named 'app'

后端 未结 3 1430
一整个雨季
一整个雨季 2020-12-31 17:08

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

3条回答
  •  迷失自我
    2020-12-31 17:37

    web:gunicorn app:app is standard Procfile. It expects that your .py file should be named app.py.

    If you want to change .py name you should change Procfile as well. web:gunicorn my_app_name:app After that you can name your file - my_app_name.py

提交回复
热议问题