-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why override flask run
?
#713
Comments
It isn't supposed to break anything. Can you describe what is the problem that you found? The reason |
@maxnoe I can't reproduce that error with latest versions of Flask and Flask-SocketIO and my own test application. Do you have a simple example I can try here, and the output of |
Having this issue inside a minimal installation using pipenv and only flask and flask_socketio with the flask hello world app. |
Oh, so you installed Flask-SocketIO in your virtualenv but are not using it in the application? |
Yes, pretty uncommon, I know. But nevertheless unexpected. |
I ran into this, when I started a new Project and intstalled |
Should be fixed in release 3.0.1. |
This fix was undone, as it affects the operation of the reloader for normal apps. Will need to find a different way to address this problem. |
Have the same issue. It's quite unorthodox for a |
@Kamforka yes, I apologize for that. This used to work fine with Flask < 1.0 versions, but some changes that went into that release are incompatible with my solution. |
@miguelgrinberg is the fix in progress or you welcome contributors to sort it out? |
This isn't at the top of my list at this time, given that it has a very easy workaround (i.e. uninstall Flask-SocketIO if you are not using it!). You are welcome to look into it. |
Hey, I don't know if this helps. But rather than installing/uninstalling flask-socketio, place if name == 'main': socketio.run(app) on applications that uses it, and then app.run() on those that don't. rather than flask run, do 'python application.py' on terminal instead |
@GlennG2012 thanks for the suggestion, however our deployment relies on |
Starting with Flask-SocketIO 3.2.0 (just released), the |
Is it necessary to drop compatibility with complex applications which use the |
@Kamforka that can all be done. What cannot be done easily is to pass through control from my modified run to the original run in the cases where this is necessary. I can't also automatically change my modified run function to match changes made to the Flask run command. When this happens my function breaks and I need to put out the fire. It brings me a lot of unhappiness, and all to support a way of starting the server that I don't even like. |
This was really unexpected to me. Just having flask-socketio installed breaks
FLASK_DEBUG=true
because it overrides theflask run
command.Why is this done and is this really necessary?
The text was updated successfully, but these errors were encountered: