I have a very simple flask application that needs to be deployed using Docker.
Currently, I'm testing in my localhost and want the server to bind to 0.0.0.0 but when I run the application it still points to 127.0.0.1
from flask import Flask, render_template
from flask import jsonify
app = Flask(__name__)
@app.route("/")
def main():
return render_template('app.html')
if __name__ == '__main__':
app.jinja_env.auto_reload = True
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.run(debug=True)
app.run(host='0.0.0.0')
Here is the startup message when I run the app -
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 904-757-118
Here is what you should do:
if __name__ == '__main__':
app.jinja_env.auto_reload = True
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.run(host='0.0.0.0', debug=True)
multiple args is not passed by multiple method call.
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