5.1 draco -- toplevel module

The module draco provides some global definitions and exceptions.

cfg_version
A string indicating Draco's version.

cfg_bindir
The directory where the Draco utility programs are installed.

cfg_datadir
The directory where the Draco support files are installed.

Handlers and templates can end the http request at any time by raising a HttpResponse exception. Below is a list of available exceptions. They are modeled as the subset of the http response codes that are applicable to Draco handlers and templates. Some HttpResponse subclasses take an optional message parameter. If Draco is in debugging mode, the error is not reported but instead a code 200 (HTTP_OK) is returned together with this message and a backtrace.

class HttpResponse( )
The base class for all http responses.

class HttpRedirect( )
The base class for all redirection (3xx) codes.

class HttpMovedPermanently( )
A resource was moved permanently. When raised, the current http request is terminated and a code 301 is returned. You should provide a "Location" http header to indicate where the resource has moved to.

class HttpFound( )
A resource was found but resides under a different URL. When raised, the current http request is terminated and a code 302 is returned. You should provide a "Location" http header to indicate where the resource can be found.

class HttpClientError( [message])
The base class for all client (4xx) errors.

class HttpBadRequest( [message])
An illegal request has been made. When raised, this terminates the http request with a code 400.

class HttpForbidden( [message])
Access to a resource was denied. When raised this terminates the http request with a code 403.

class HttpNotFound( [message])
A resouce was requested that could not be found. When raised this terminates the http request with a code 404.

class HttpGone( [message])
A resource was requested that is permanently gone. When raised this terminates the http request with a code 410.

class HttpServerError( [message])
Base class for all server (5xx) errors.

class HttpInternalServerError( [message])
An internal server error has occurred. When raised, this terminates the http request with a code 500.

class HttpServiceUnavailable( [message])
A resource is temporarily unavailable. When raised, this terminates the http request with a code 503.