Adding parameters to routes in Flask

Parameters in Flask routes are surrounded by < and >. The name you use for the parameter it is passed to the routing function as keyword argument.

def list_view(resource):
    return "{}".format(resource)

Converter types

You can constrain parameters using converter types. The options for converter types are string, int, float, path and uuid. You include them as follows.

def list_view(resource):
    return "{}".format(resource)

Flask Version

$ flask --version
Python 3.8.5
Flask 1.1.2
Werkzeug 1.0.1

See Also

6 Non-Programming Books for Programmers