Python Flask how to get parameters from a URL?

In Flask, How do I extract parameters from a URL? How can I extract named parameters from a URL using flask and python?

When the user accesses this URL running on my flask app, I want the web service to be able to handle the parameters specified after the question mark:

    #I just want to be able to manipulate the parameters
    @app.route('/login', methods=['GET', 'POST'])
    def login():
        username = request.form['username']
        password = request.form['password']

Use request.args to get parsed contents of query string:

    from flask import request

    def login():
        username = request.args.get('username')
        password = request.args.get('password')


Back to homepage or read more recommendations: