当前位置: 首页 > 面试题库 >

无法加载应用程序0(mountpoint ='')-Flask app with uwsgi

鄢选
2023-03-14
问题内容

我在下面的结构中有一个python flask应用程序

Admin |-app | -__init__.py |-wsgi.py

我的wsgi.py内容如下

#!/usr/bin/python

from app import app
from app import views


if __name__ == '__main__':
    app.run()

应用程序包中init .py的内容

#!/usr/bin/python

from flask import Flask

app = Flask(__name__)

我以如下方式启动了wsgi

uwsgi --socket 127.0.0.1:8080 --protocol=http -w wsgi

服务器成功启动,但是我在启动日志中会出错,如下所示

*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 709
your memory page size is 4096 bytes
detected max file descriptor number: 256
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8080 fd 3
Python version: 2.7.6 (default, Sep  9 2014, 15:04:36)  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x7fd7eb6000d0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 70195, cores: 1)

发布了类似的问题,但是为这些问题提供的解决方案已经在我的代码中。我无法找到为什么出现此错误。

谢谢


问题答案:

“未找到可调用的问题”(我怀疑不是导入错误)。更改:

uwsgi --socket 127.0.0.1:8080 --protocol=http -w wsgi

进入这个

uwsgi --socket 127.0.0.1:8080 --protocol=http -w wsgi:app

要么

uwsgi --socket 127.0.0.1:8080 --protocol=http --module wsgi --callable app


 类似资料:
  • 部署在Heroku上的Rails应用程序无法加载。我设置了数据库迁移,我还有puma和procfile。。。我真的不知道。 这是我的日志: 宝石文件 程序文件 配置/puma.rb 工人整数(ENV['WEB_CONCURRENCY']||2)threads_count=整数(ENV['RAILS_MAX_THREADS']||5)线程threads_count,threads_count pre

  • 问题内容: 尝试使用uWSGI启动Flask时出现以下错误。这是我的开始方式: 这是我的目录结构: 内容 内容 问题答案: 我的flask应用程序位于名为的变量中,因此我无法接受该解决方案。你可以通过将以下内容放入你的wsgi中来解决此问题: 因此,问题很简单,uwsgi需要一个名为的变量。

  • 我已经提供了Linux SWT jar,并在Eclipse中打包了应用程序,以便在应用程序的jar中包含SWT.jar。当我尝试在Ubuntu上运行它时,我得到了以下错误文本(发布只是原因):

  • 我正在处理一个Spring Boot应用程序,其中我使用该应用程序公开SOAP WebService。我在Spring boot应用程序中使用Apache CFX framework for SOAP impl。我正在使用基于注释的方法。 我在一个bean中的Spring Boot配置文件中设置应用程序上下文时遇到了问题。下面是我的代码。 配置文件如下所示。 现在我有了bean SOAPproce

  • 无法加载web应用程序,控制台显示以下内容 InstallationHandlers。isRegistered()失败,原因:sun.security.validator。ValidatorException:PKIX路径生成失败:sun.security.provider.certpath。SunCertPathBuilderException:无法找到请求目标的有效证书路径 这意味着什么?知道