I am trying to run my Flask app under uWSGI and am getting:
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
The layout is:
/opt/myapp
/opt/myapp/wsgi.py
/opt/myapp/run.py
/opt/myapp/lib
/opt/myapp/app
/opt/myapp/app/blueprints.py
/opt/myapp/app/filters
/opt/myapp/app/filters/__init__.py
/opt/myapp/app/__init__.py
/opt/myapp/app/main.py
app/__init__.py
contains the usual:
from flask import Flask
app = Flask(__name__)
app/main.py
looks like:
import blueprints
import filters
from app import app
def run(debug, host='0.0.0.0'):
app.run(debug=debug, host=host)
wsgi.py
looks like:
if __name__ == '__main__':
from app.main import app as application
application.run(host='0.0.0.0')
If I run python wsgi.py
from the CLI, it works fine, the usual :5000
server.
If I run:
uwsgi --socket 0.0.0.0:8080 --protocol=http -w wsgi
I see the error, it cannot load the application.