updating flask code used for local host 127.0.0.1:5000

Deadly 提交于 2020-03-04 22:20:28

问题


I am trying to develop a simple webpage using the Spyder IDE and Flask. I created the standard 'hello world' page.

From within Spyder I ran the script which I also tried running from the Windows Command Prompt/ Using the command python main.py I was able to launch my hello world webpage in http://127.0.0.1:5000/

I've gone back and updated the file to change the display text. Saved the file, restarted the code and the same content appears.

I have cleared the cache from the chrome browser I am already using. I have opened this same address in other browsers (firefox and IE). I created another version of this file in a different folder and also launched it.

from flask import Flask

app = Flask(__name__)

@app.route("/")
def home():
    return "Hello, World! anyone?"

@app.route("/page2")
def salvador():
    return "Hello, there"

if __name__ == "__main__":
    app.run(debug=True)

No matter what I do, I get the same original hello world webpage.

来源:https://stackoverflow.com/questions/57699467/updating-flask-code-used-for-local-host-127-0-0-15000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!