0

This is my code for application.py

from flask import Flask, render_template

app = Flask(__name__)

@app.route("/")
def index():
    return render_template("index.html")

@app.route("/zuck")
def zuck():
    return render_template("zuck.html")

@app.route("/login")
def login():
    return render_template("login.html")

This is pretty much the same as what David types out but when I type flask run in the terminal window, it throws up a bunch of nasty errors Error msg

Please help! What could the issue be?

davidism
  • 121,510
  • 29
  • 395
  • 339
  • This is a warning, not an error. If you are not running this in a production environment you are fine. – Dietrich Epp Oct 23 '18 at 16:08
  • This has always been strongly suggested in Flask but I think in 1.0 they made the warning in red text. That's why it may not look the same as whatever guide you're following – roganjosh Oct 23 '18 at 16:14
  • But clearly I am in a production environment because it says so right there. How do I switch to WSGI? – Nandhitha Ravindran Oct 23 '18 at 16:18
  • 1
    No it doesn't. It says _if you are in a production environment_. If you are not familiar with this error then it's very unlikely you have your app in production, you're just doing development. [These are the deployment options](http://flask.pocoo.org/docs/1.0/deploying/) when you move to production. – roganjosh Oct 23 '18 at 16:22
  • Read above that line, it does say 'environment: production'. But thanks to Stephen, the link he shared helped me fix it. Now it says 'environment: development'. – Nandhitha Ravindran Oct 23 '18 at 16:27
  • Interesting. I don't know how Flask makes that distinction, I will look into what it is actually trying to say. – roganjosh Oct 23 '18 at 16:56

1 Answers1

1

If you want to turn of debug mode, you can do that in the app.run function call

app.run(debug=False)

But as Dietrich Epp mentioned in the comment, it's not an error, just a warning.

You can read more about flask debug mode here.

Stephen C
  • 1,966
  • 1
  • 16
  • 30