【问题标题】:Flask and dash together: Working on virtual ENV but not in the serverFlask 和 dash 一起使用:在虚拟 ENV 上工作,但不在服务器中
【发布时间】:2021-01-08 18:35:12
【问题描述】:

我有一个从烧瓶运行 dash 的应用程序。我是按照 hackesandslackers here 的指示制作的

该应用在我的虚拟环境中运行没有任何问题。

我正在按照他们网站here 的说明在 ubuntu 上使用 Linode 部署我的应用程序。

但是,当我到达Install and Configure Gunicorn 部分并运行gunicorn -w 3 PlantPhyto:app 时,出现以下错误:

    from PlantPhyto import create_app
ImportError: cannot import name 'create_app' from partially initialized module 'PlantPhyto' (most likely due to a circular import) (/home/PlantPhyto/__init__.py)

有人有类似的经验吗?

澄清我对烧瓶和一般编程非常陌生。 提前感谢您的帮助。

【问题讨论】:

    标签: ubuntu flask plotly-dash linode


    【解决方案1】:

    好吧...这很尴尬,但正如我所说:我是编程方面的新手。

    问题是我调用了初始文件__init__.py。所以这引发了问题。我重新命名为wsgi.py,现在运行没有问题。我不知道是否需要它具有该特定名称,但这就是我所做的并且问题已解决。 xD

    【讨论】:

      猜你喜欢
      • 2021-06-15
      • 2021-12-14
      • 1970-01-01
      • 2021-10-01
      • 2020-05-05
      • 2017-02-07
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      相关资源
      最近更新 更多