If I have a function
@app.after_request
def foo():
....
which is used after almost every request, but not for some, can I ignore the above for some requests?
If I have a function
@app.after_request
def foo():
....
which is used after almost every request, but not for some, can I ignore the above for some requests?
You can try something like this -
@app.after_request
def foo():
if request.endpoint != 'endpoint' :
.... your code
else:
return
Here replace 'endpoint' with the endpoints you want to skip