unable to load app 0 (mountpoint='') - Flask app with uwsgi

亡梦爱人 提交于 2020-04-08 03:26:56

问题


I have a python flask app in below structure

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

My wsgi.py contents is as follows

#!/usr/bin/python

from app import app
from app import views


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

Contents of init.py in app package

#!/usr/bin/python

from flask import Flask

app = Flask(__name__)

I started wsgi as below

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

The server is started successfully but I can error in startup log as below

*** 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)

Similar issues were posted but whatever solutions offered for those issues are already in my code. I am not able to find why I am getting this error.

Thanks


回答1:


"Callable not found is the issue" (not the import error, i suspect). Change:

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

into this

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

or

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

see here, search for 'flask deploy'.



来源:https://stackoverflow.com/questions/31476441/unable-to-load-app-0-mountpoint-flask-app-with-uwsgi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!