In python flask, how do you get the path parameters outside of the route function? [duplicate]

It’s possible to use request.view_args.
The documentation defines it this way:

A dict of view arguments that matched the request.

Here’s an example:

@app.route("/data/<section>")
def data(section):
    assert section == request.view_args['section']

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)