I wrote basic code for Python flask, but I got 404 error

Asked 6 days ago, Updated 6 days ago, 1 views

from flask import Flask

app = Flask(__name__)
@app.route("/hello")
def hello():
    return "<h1> Hello World! </h1>"

if __name__ == "__main__":
    app.run()`

Writing the following basic code does not run normally and results in a 404 error: I've been looking for it for two hours, but I don't know the reason, is there anyone who knows?

* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
127.0.0.1 - - [26/Sep/2021 23:41:25] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [26/Sep/2021 23:41:25] "GET /favicon.ico HTTP/1.1" 404 -

This is the only result.

python flask

2022-09-20 15:02

1 Answers

If you have any answers or tips


© 2022 pinfo. All rights reserved.