I have the following function with multiple routes possible :
@bp.route('/list/', defaults={'status': None, 'time': None, 'search': None})
@bp.route('/list/lot/', defaults={'status': None, 'search': None, 'time': None})
@bp.route('/list/lot/<string:time>/', defaults={'status': None, 'search': None})
@bp.route('/list/lot/<string:time>/<string:status>', defaults={'search': None})
@bp.route('/list/lot/<string:time>/<string:status>?search=<path:search>')
@login_required
def index(status, time, search):
print(search)
All the routes works well, except the last one. I have the URL likes this :
http://192.168.10.88:5000/list/lot/OLDER/NEW?search=test
And I don't understand why, the print always return None.
Any ideas ?
Thanks
request. Not in function argument. Just importfrom flask import requestand thenrequest.args.get('search')inside the function