Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Gunicorn在运行heroku日志时返回错误_Python_Heroku_Gunicorn - Fatal编程技术网

Python Gunicorn在运行heroku日志时返回错误

Python Gunicorn在运行heroku日志时返回错误,python,heroku,gunicorn,Python,Heroku,Gunicorn,当运行heroku logs--tail时,我得到以下错误无限循环。主要错误是我无法理解的“意外的额外参数”。我的procfile是web:gunicorn app:app,我的主“.py”文件是app.py。所以procfile很好。我真的不知道这里发生了什么。提前谢谢 [2020-05-06 22:18:21 +0000] [4256] [INFO] Worker exiting (pid: 4256) 2020-05-06T22:18:21.783472+00:00 app[web.1]:

当运行heroku logs--tail时,我得到以下错误无限循环。主要错误是我无法理解的“意外的额外参数”。我的procfile是
web:gunicorn app:app
,我的主“.py”文件是app.py。所以procfile很好。我真的不知道这里发生了什么。提前谢谢

[2020-05-06 22:18:21 +0000] [4256] [INFO] Worker exiting (pid: 4256)
2020-05-06T22:18:21.783472+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4258] [INFO] Booting worker with pid: 4258
2020-05-06T22:18:21.803986+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:21.803987+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:21.803988+00:00 app[web.1]: 
2020-05-06T22:18:21.804014+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:21.804437+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4257] [INFO] Worker exiting (pid: 4257)
2020-05-06T22:18:21.891864+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4259] [INFO] Booting worker with pid: 4259
2020-05-06T22:18:22.412798+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:22.412829+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:22.412829+00:00 app[web.1]: 
2020-05-06T22:18:22.412836+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:22.413113+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4258] [INFO] Worker exiting (pid: 4258)
2020-05-06T22:18:22.490604+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:22.490606+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:22.490606+00:00 app[web.1]: 
2020-05-06T22:18:22.490613+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:22.490941+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4259] [INFO] Worker exiting (pid: 4259)
2020-05-06T22:18:22.499552+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4260] [INFO] Booting worker with pid: 4260
下面是我的个人资料:

web: gunicorn app:app

据我所知,在函数中传递字符串时会发生此错误,请避免这样做。
不要在函数定义中将字符串作为参数传递

在Heroku上使用flask时,我遇到了相同的问题。这就是我的问题:

Initdb()
是一个生成SQL数据库的函数。我注释掉了以下代码并解决了问题:

Try:
    Init_db_command()    
Except sqlite3.operationalError:
    Pass