Flask 3 · Routes and requests

Return an error

Stop the request with an HTTP error code.

from flask import abort

abort(404)

Official Flask 3 documentation

More routes and requests commands

All routes and requests commands · Flask 3 cheatsheet

Was this page helpful?