You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from flask import Flask
from flask_uwsgi_websocket import GeventWebSocket
app = Flask(__name__.split('.')[0])
print("name is: {}".format(__name__.split('.')[0]))
print(app.name)
print(app.import_name)
websocket = GeventWebSocket(app)
@websocket.route('/echo')
def echo(ws):
while True:
msg = ws.receive()
ws.send(msg)
@app.route('/hello')
def hallo():
return 'Hello'
if __name__ == '__main__':
app.run(gevent=100)
As recommended in the flask docu http://flask.pocoo.org/docs/1.0/api/ I use app = Flask(__name__.split('.')[0]) for the name.
But flask_uwsgi_websocket will generate the following uwsgi call:
I've placed my app in a package like that:
The code of
echo.py
isAs recommended in the flask docu http://flask.pocoo.org/docs/1.0/api/ I use
app = Flask(__name__.split('.')[0])
for the name.But
flask_uwsgi_websocket
will generate the following uwsgi call:which results in
ModuleNotFoundError: No module named 'echo'
Instead of:
Starting uwsgi directly with this command works.
The text was updated successfully, but these errors were encountered: