Module Expr Str Import alias Import alias Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str ClassDef bases NameLoad NameLoad body FunctionDef arguments args NameParam NameParam defaults NameLoad vararg kwarg body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr Num attr attr Str Assign AttributeStore NameLoad attr BoolOpOr NameLoad BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return BinOpMod Str Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad BinOpMod Str Dict Str Str Str AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return ListLoad TupleLoad Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad Str Call AttributeLoad Str attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Str decorator_list Assign NameStore Dict Assign NameStore ListLoad Str FunctionDef arguments args defaults body For TupleStore NameStore NameStore Call NameLoad Call NameLoad body TryExcept body If CompareIsNot Call NameLoad NameLoad Str NameLoad NameLoad body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Continue decorator_list Expr Call NameLoad Delete NameDel ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad keyword NameLoad If CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str NameLoad Raise Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad NameLoad decorator_list decorator_list Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad ImportFrom alias ImportFrom alias
N/A N/A 
    werkzeug.exceptions
    ~~~~~~~~~~~~~~~~~~~

    This module implements a number of Python exceptions you can raise from
    within your views to trigger a standard non-200 response.


    Usage Example
    -------------

    ::

        from werkzeug.wrappers import BaseRequest
        from werkzeug.wsgi import responder
        from werkzeug.exceptions import HTTPException, NotFound

        def view(request):
            raise NotFound()

        @responder
        def application(environ, start_response):
            request = BaseRequest(environ)
            try:
                return view(request)
            except HTTPException as e:
                return e


    As you can see from this example those exceptions are callable WSGI
    applications.  Because of Python 2.4 compatibility those do not extend
    from the response objects but only from the python exception class.

    As a matter of fact they are not Werkzeug response objects.  However you
    can get a response object by calling ``get_response()`` on a HTTP
    exception.

    Keep in mind that you have to pass an environment to ``get_response()``
    because some errors fetch additional information from the WSGI
    environment.

    If you want to hook in a different exception page to say, a 404 status
    code, you can add a second except for a specific subclass of an error::

        @responder
        def application(environ, start_response):
            request = BaseRequest(environ)
            try:
                return view(request)
            except NotFound, e:
                return not_found(request)
            except HTTPException, e:
                return e


    :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
 N/A sys N/A werkzeug N/A N/A werkzeug exceptions N/A N/A sys modules N/A __name__ werkzeug._internal _get_environ werkzeug._compat iteritems integer_types text_type implements_to_string werkzeug.wrappers Response HTTPException N/A Exception N/A N/A 
    Baseclass for all HTTP exceptions.  This exception can be called as WSGI
    application to render a default error page or you can catch the subclasses
    of it independently and render nicer error messages.
     N/A code None N/A description None __init__ N/A N/A self description response N/A None None N/A N/A N/A N/A Exception __init__ self N/A N/A description None N/A N/A N/A self description description N/A N/A self response response N/A wrap N/A N/A cls exception name N/A None N/A N/A This method returns a new subclass of the exception provided that
        also is a subclass of `BadRequest`.
         newcls N/A cls exception N/A __init__ N/A N/A self arg N/A None args kwargs N/A N/A N/A N/A cls __init__ self args kwargs N/A N/A N/A exception __init__ self arg N/A N/A N/A N/A newcls __module__ N/A N/A N/A N/A N/A sys _getframe 1 f_globals get __name__ N/A N/A newcls __name__ N/A name N/A N/A cls __name__ N/A exception __name__ N/A newcls N/A classmethod name N/A N/A self N/A N/A N/A The status name. N/A N/A N/A HTTP_STATUS_CODES get N/A self code Unknown Error N/A property get_description N/A N/A self environ N/A None N/A N/A Get the description. N/A N/A <p>%s</p> N/A escape N/A self description N/A get_body N/A N/A self environ N/A None N/A N/A Get the HTML body. N/A N/A text_type N/A <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>%(code)s %(name)s</title>
<h1>%(name)s</h1>
%(description)s
 N/A code name description N/A self code N/A escape N/A self name N/A N/A self get_description environ N/A get_headers N/A N/A self environ N/A None N/A N/A Get a list of headers. N/A N/A N/A Content-Type text/html N/A get_response N/A N/A self environ N/A None N/A N/A Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
         N/A N/A N/A self response None N/A N/A N/A self response N/A N/A environ None N/A N/A environ N/A _get_environ environ N/A headers N/A N/A self get_headers environ N/A N/A Response N/A N/A self get_body environ N/A self code headers N/A __call__ N/A N/A self environ start_response N/A N/A N/A Call the exception as WSGI application.

        :param environ: the WSGI environment.
        :param start_response: the response callable provided by the WSGI
                               server.
         N/A response N/A N/A self get_response environ N/A N/A response environ start_response N/A __str__ N/A N/A self N/A N/A N/A N/A %d: %s N/A N/A self code N/A self name N/A __repr__ N/A N/A self N/A N/A N/A N/A <%s '%s'> N/A N/A N/A self __class__ __name__ self N/A N/A implements_to_string BadRequest N/A HTTPException N/A N/A *400* `Bad Request`

    Raise if the browser sends something to the application the application
    or server cannot handle.
     N/A code 400 N/A description The browser (or proxy) sent a request that this server could not understand. N/A ClientDisconnected N/A BadRequest N/A N/A Internal exception that is raised if Werkzeug detects a disconnected
    client.  Since the client is already gone at that point attempting to
    send the error message to the client might not work and might ultimately
    result in another exception in the server.  Mainly this is here so that
    it is silenced by default as far as Werkzeug is concerned.

    Since disconnections cannot be reliably detected and are unspecified
    by WSGI to a large extend this might or might not be raised if a client
    is gone.

    .. versionadded:: 0.8
     N/A SecurityError N/A BadRequest N/A N/A Raised if something triggers a security error.  This is otherwise
    exactly like a bad request error.

    .. versionadded:: 0.9
     N/A Unauthorized N/A HTTPException N/A N/A *401* `Unauthorized`

    Raise if the user is not authorized.  Also used if you want to use HTTP
    basic auth.
     N/A code 401 N/A description The server could not verify that you are authorized to access the URL requested.  You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required. N/A Forbidden N/A HTTPException N/A N/A *403* `Forbidden`

    Raise if the user doesn't have the permission for the requested resource
    but was authenticated.
     N/A code 403 N/A description You don't have the permission to access the requested resource. It is either read-protected or not readable by the server. N/A NotFound N/A HTTPException N/A N/A *404* `Not Found`

    Raise if a resource does not exist and never existed.
     N/A code 404 N/A description The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again. N/A MethodNotAllowed N/A HTTPException N/A N/A *405* `Method Not Allowed`

    Raise if the server used a method the resource does not handle.  For
    example `POST` if the resource is view only.  Especially useful for REST.

    The first argument for this exception should be a list of allowed methods.
    Strictly speaking the response would be invalid if you don't provide valid
    methods in the header which you can do with that list.
     N/A code 405 N/A description The method is not allowed for the requested URL. __init__ N/A N/A self valid_methods description N/A None None N/A N/A Takes an optional list of valid http methods
        starting with werkzeug 0.3 the list will be mandatory. N/A N/A N/A HTTPException __init__ self description N/A N/A self valid_methods valid_methods N/A get_headers N/A N/A self environ N/A N/A N/A headers N/A N/A HTTPException get_headers self environ N/A N/A self valid_methods N/A N/A N/A N/A headers append N/A Allow N/A N/A ,  join N/A self valid_methods N/A headers N/A N/A NotAcceptable N/A HTTPException N/A N/A *406* `Not Acceptable`

    Raise if the server can't return any content conforming to the
    `Accept` headers of the client.
     N/A code 406 N/A description The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request. N/A RequestTimeout N/A HTTPException N/A N/A *408* `Request Timeout`

    Raise to signalize a timeout.
     N/A code 408 N/A description The server closed the network connection because the browser didn't finish the request within the specified time. N/A Conflict N/A HTTPException N/A N/A *409* `Conflict`

    Raise to signal that a request cannot be completed because it conflicts
    with the current state on the server.

    .. versionadded:: 0.7
     N/A code 409 N/A description A conflict happened while processing the request.  The resource might have been modified while the request was being processed. N/A Gone N/A HTTPException N/A N/A *410* `Gone`

    Raise if a resource existed previously and went away without new location.
     N/A code 410 N/A description The requested URL is no longer available on this server and there is no forwarding address.</p><p>If you followed a link from a foreign page, please contact the author of this page. N/A LengthRequired N/A HTTPException N/A N/A *411* `Length Required`

    Raise if the browser submitted data but no ``Content-Length`` header which
    is required for the kind of processing the server does.
     N/A code 411 N/A description A request with this method requires a valid <code>Content-Length</code> header. N/A PreconditionFailed N/A HTTPException N/A N/A *412* `Precondition Failed`

    Status code used in combination with ``If-Match``, ``If-None-Match``, or
    ``If-Unmodified-Since``.
     N/A code 412 N/A description The precondition on the request for the URL failed positive evaluation. N/A RequestEntityTooLarge N/A HTTPException N/A N/A *413* `Request Entity Too Large`

    The status code one should return if the data submitted exceeded a given
    limit.
     N/A code 413 N/A description The data value transmitted exceeds the capacity limit. N/A RequestURITooLarge N/A HTTPException N/A N/A *414* `Request URI Too Large`

    Like *413* but for too long URLs.
     N/A code 414 N/A description The length of the requested URL exceeds the capacity limit for this server.  The request cannot be processed. N/A UnsupportedMediaType N/A HTTPException N/A N/A *415* `Unsupported Media Type`

    The status code returned if the server is unable to handle the media type
    the client transmitted.
     N/A code 415 N/A description The server does not support the media type transmitted in the request. N/A RequestedRangeNotSatisfiable N/A HTTPException N/A N/A *416* `Requested Range Not Satisfiable`

    The client asked for a part of the file that lies beyond the end
    of the file.

    .. versionadded:: 0.7
     N/A code 416 N/A description The server cannot provide the requested range. N/A ExpectationFailed N/A HTTPException N/A N/A *417* `Expectation Failed`

    The server cannot meet the requirements of the Expect request-header.

    .. versionadded:: 0.7
     N/A code 417 N/A description The server could not meet the requirements of the Expect header N/A ImATeapot N/A HTTPException N/A N/A *418* `I'm a teapot`

    The server should return this if it is a teapot and someone attempted
    to brew coffee with it.

    .. versionadded:: 0.7
     N/A code 418 N/A description This server is a teapot, not a coffee machine N/A UnprocessableEntity N/A HTTPException N/A N/A *422* `Unprocessable Entity`

    Used if the request is well formed, but the instructions are otherwise
    incorrect.
     N/A code 422 N/A description The request was well-formed but was unable to be followed due to semantic errors. N/A PreconditionRequired N/A HTTPException N/A N/A *428* `Precondition Required`

    The server requires this request to be conditional, typically to prevent
    the lost update problem, which is a race condition between two or more
    clients attempting to update a resource through PUT or DELETE. By requiring
    each client to include a conditional header ("If-Match" or "If-Unmodified-
    Since") with the proper value retained from a recent GET request, the
    server ensures that each client has at least seen the previous revision of
    the resource.
     N/A code 428 N/A description This request is required to be conditional; try using "If-Match" or "If-Unmodified-Since". N/A TooManyRequests N/A HTTPException N/A N/A *429* `Too Many Requests`

    The server is limiting the rate at which this user receives responses, and
    this request exceeds that rate. (The server may use any convenient method
    to identify users and their request rates). The server may include a
    "Retry-After" header to indicate how long the user should wait before
    retrying.
     N/A code 429 N/A description This user has exceeded an allotted request count. Try again later. N/A RequestHeaderFieldsTooLarge N/A HTTPException N/A N/A *431* `Request Header Fields Too Large`

    The server refuses to process the request because the header fields are too
    large. One or more individual fields may be too large, or the set of all
    headers is too large.
     N/A code 431 N/A description One or more header fields exceeds the maximum size. N/A InternalServerError N/A HTTPException N/A N/A *500* `Internal Server Error`

    Raise if an internal server error occurred.  This is a good fallback if an
    unknown error occurred in the dispatcher.
     N/A code 500 N/A description The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application. N/A NotImplemented N/A HTTPException N/A N/A *501* `Not Implemented`

    Raise if the application does not support the action requested by the
    browser.
     N/A code 501 N/A description The server does not support the action requested by the browser. N/A BadGateway N/A HTTPException N/A N/A *502* `Bad Gateway`

    If you do proxying in your application you should return this status code
    if you received an invalid response from the upstream server it accessed
    in attempting to fulfill the request.
     N/A code 502 N/A description The proxy server received an invalid response from an upstream server. N/A ServiceUnavailable N/A HTTPException N/A N/A *503* `Service Unavailable`

    Status code you should return if a service is temporarily unavailable.
     N/A code 503 N/A description The server is temporarily unable to service your request due to maintenance downtime or capacity problems.  Please try again later. N/A N/A default_exceptions N/A N/A __all__ N/A HTTPException _find_exceptions N/A N/A N/A N/A N/A N/A name obj N/A iteritems N/A globals N/A N/A N/A N/A N/A N/A getattr obj code None None N/A N/A N/A default_exceptions N/A N/A obj code obj N/A N/A N/A __all__ append N/A obj __name__ N/A N/A N/A TypeError N/A N/A N/A N/A N/A _find_exceptions N/A _find_exceptions Aborter N/A object N/A N/A 
    When passed a dict of code -> exception items it can be used as
    callable that raises exceptions.  If the first argument to the
    callable is an integer it will be looked up in the mapping, if it's
    a WSGI application it will be raised in a proxy exception.

    The rest of the arguments are forwarded to the exception constructor.
     __init__ N/A N/A self mapping extra N/A None None N/A N/A N/A mapping None N/A N/A mapping default_exceptions N/A N/A self mapping N/A dict mapping N/A N/A extra None N/A N/A N/A N/A N/A self mapping update extra N/A __call__ N/A N/A self code N/A args kwargs N/A N/A N/A N/A args N/A kwargs N/A N/A isinstance code integer_types N/A N/A N/A HTTPException response code N/A N/A code N/A self mapping N/A N/A N/A LookupError N/A no exception for %r code N/A N/A N/A N/A self mapping N/A code args kwargs N/A N/A N/A abort N/A Aborter N/A BadRequestKeyError N/A N/A BadRequest wrap KeyError werkzeug.utils escape werkzeug.http HTTP_STATUS_CODES