为什么我在烧瓶上的hellow World上得到404?

时间:2019-12-16 14:03:04

标签: python flask

我在flask上是新的,我试图写一个hello world,但是即使在控制台上标记了请求,所有路由仍在响应404,我已经尝试更改应用的端口,删除调试器模式,更改路由路径,什么都没有改变

from flask import Flask

#init app
app = Flask(__name__)

app.route('/', methods=['GET'])
def get():
    return "hello world"


# run server
if __name__ == '__main__':
    app.run(port=8080)

控制台输出:

 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:4996/ (Press CTRL+C to quit)
127.0.0.1 - - [16/Dec/2019 11:01:47] "GET / HTTP/1.1" 404 -

0 个答案:

没有答案