Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/330.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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 没有名为wsgi的模块_Python_Django_Heroku_Gunicorn_Foreman - Fatal编程技术网

Python 没有名为wsgi的模块

Python 没有名为wsgi的模块,python,django,heroku,gunicorn,foreman,Python,Django,Heroku,Gunicorn,Foreman,这是我的程序文件中的内容: web: gunicorn --pythonpath meraki meraki.wsgi 当我执行工头启动时,我得到以下错误: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 我在shell中导入了wsgi,导入成功,没有错误 为什么我不能启动领班 项目结构: meraki meraki //other apps meraki

这是我的
程序文件中的内容:

web: gunicorn --pythonpath meraki meraki.wsgi
当我执行
工头启动时
,我得到以下错误:

gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
我在shell中导入了wsgi,导入成功,没有错误

为什么我不能启动领班

项目结构:

meraki
  meraki
      //other apps
      meraki
          settings
          __init__.py
          celery.py
          views.py
          wsgi.py
      manage.py
  Procfile
  requirements
  requirements.txt

你已经被一个不必要的复杂结构弄糊涂了。您不需要外部meraki目录,Procfile和requirements.txt应该与manage.py位于同一目录中。然后您可以删除pythonpath参数,一切都会好起来。

正如Roseman所说,它是不必要的复杂结构。如果您希望它这样做,请尝试

web: gunicorn --pythonpath /path/to/meraki meraki.wsgi

这就是包含
应用程序的
/absolutepath/to/secondmeroki(共3个)
你能发布你的项目结构吗?你为什么要添加pythonpath参数?你没有列出
\u init\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuupy
与你上面结构中的
wsgi.py
存在于同一个目录中吗?你必须要有它才能工作。这是一个关键文件,如果不列出它(如果它确实存在),将导致对这个问题做出许多错误的结论。@GrahamDumpleton您是对的。我更新了问题。谢谢:)你说得对。我试着把他们搬进去,结果成功了。我只是在遵循《两勺django》一书中给出的建议。除此之外,这不是我第一次使用这种结构,而且它过去工作起来没有问题:)我想知道这里发生了什么:)作为最后的手段,我会按照你的建议去做。谢谢:)谢谢你的回答。但是,当我在生产中部署绝对路径时,绝对路径将不起作用:)因此,我认为正如你们建议的那样,我将简化结构并将
Procfile
insideYes移动,否则,您必须为您的生产进行不同的设置。
web: gunicorn --pythonpath /path/to/meraki meraki.wsgi