Env. Variables not set while running Minimal Flask application

前端 未结 19 2037

I am trying to follow the flask documentation on my windows machine given at the following link: http://flask.pocoo.org/docs/0.11/quickstart/#debug-mode

Firstly I wrote

19条回答
  •  情话喂你
    2021-01-30 04:00

    I wonder why this is missing from the answer.

    Here is a simple solution:

    add app.run(port=5000)

    from flask import Flask
    app = Flask(__name__)
    
    @app.route("/")
    def hello():
        return "Hello World!"
    
    app.run(port=5000)
    

    and then in the same directory run the command

    python run.app
    

提交回复
热议问题