Env. Variables not set while running Minimal Flask application

前端 未结 19 2048

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 03:52

    I was having this same problem running the commands as stated in Flask quick start. using Powershell on windows 10

    projects>set export FLASK_APP=hello.py
    projects>flask run
     * Running on http://127.0.0.1:5000/
    

    I needed to type python while being in the directory containing the file with from flask import Flask app = Flask(name)

    @app.route('/')
    def hello_world():
        return 'Hello, World!
    

    after that you will get a message with an IP address in it

     * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    

    you copy IP address into your browser and your to that point you should see your hello world statement then.

提交回复
热议问题