How to check for the existence of a get parameter in flask
You can actually use the default value,
opt_param = request.args.get("something")
if opt_param is None:
print "Argument not provided"
A more Pythonic way to do the same would be using the in
operator:
if 'varname' in request.args:
# parameter 'varname' is specified
varname = request.args.get('varname')
else:
# parameter 'varname' is NOT specified