I'm catching 404 errors on my website with this function:
@app.errorhandler(404)
def page_not_found(e):
logger.warning('User raised an 404: {error}'.format(error=str(e)))
return render_template('404.html'), 404
But I would like to know which url the user tried to access to raise the 404, is they a simple way to do this?
Use request.path
to know which url tried to access and raised 404.
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