57

Web で見つけた答えは、 を使用することrequest.args.getです。しかし、私はそれを機能させることができません。次の簡単な例があります。

from flask import Flask
app = Flask(__name__)

@app.route("/hello")
def hello():
    print request.args['x']
    return "Hello World!"

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

127.0.0.1:5000/hello?x=2ブラウザで にアクセスすると、次の結果が得られます。

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

私は何を間違っていますか?

4

2 に答える 2