When running flask app, like
...
if __name__ is "__main__":
app.run(port=self.port)
...
There are some messages for running.
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
How I disable all these messages?
To disable Flask from displaying warning banner messsage about using a development server in a production environment, add the 2 cli lines before running flask:
from flask import Flask
import sys
cli = sys.modules['flask.cli']
cli.show_server_banner = lambda *x: None
app = Flask(__name__)
app.run(host='0.0.0.0', port='80')
https://gist.github.com/jerblack/735b9953ba1ab6234abb43174210d356
try this. export WERKZEUG_RUN_MAIN=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With