Flask is a microframework for server-side web development in Python.
Because 200 is the default, it is not needed for a normal response. However, the most correct response would be to return the code “200” along with any textual data.
Along with route(), there is also the errorhandler() function. This takes as a parameter the status code or the name of a known exception.
In order to pass back the error, the code should also be returned. This allows the server to correctly register the error to the user.
However, the render_template() can also be used to deliver specific error files or templates along with any other reactions.