I am trying to get a url parameter in Python.
I am using this code:
from flask import request, url_for, redirect
# ...
controller = request.get('controller')
but I am getting this error:
'Request' object has no attribute 'get'
Any ideas?
Thanks
You want to use request.args
for your GET parameters in Flask. Here is a quote with an example from the Accessing Request Data section of the Quickstart document.
To access parameters submitted in the URL (?key=value) you can use the args attribute:
searchword = request.args.get('key', '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With