如何在Heroku上使用异常文件结构部署Flask MySQL应用程序?

时间:2018-04-01 16:12:44

标签: heroku flask

我的本​​地计算机上有一个正在运行的应用程序。文件结构是:

nobanter
        betDeNoBanter.xlsx
        database(directory)
        fetchMatches.py  
        flask-env(virtual-env folder)
        helloScript.py
        index.py(main file)
        index.pyc  
        Procfile  (a file whose contents are mentioned below)
        templates(directory)  
        testingSheets.py

页面https://medium.com/@johnkagga/deploying-a-python-flask-app-to-heroku-41250bda27d0中提及的说明中Procfile的内容:

web: gunicorn app:app

我明白我的主文件名为index.pyProcfile的内容应该是什么?

1 个答案:

答案 0 :(得分:0)

从同一个教程:

  Heroku使用

web为应用程序启动Web服务器。 app:app指定模块和应用程序名称。在我们的应用程序中,我们有app模块,我们的flask应用程序也称为app。如果你的不同,你可以改变它们。

因此,您需要使用index:something,其中something是您的Flask应用的名称。如果您的index.py文件包含

app = Flask(__name__)

就像在Flask快速入门中一样,您将使用web: gunicorn index:app

相关问题