wsgiref.handlers.BaseHandler.sendfile()

sendfile() Override to implement platform-specific file transmission. This method is called only if the application’s return value is an instance of the class specified by the wsgi_file_wrapper attribute. It should return a true value if it was able to successfully transmit the file, so that the default transmission code will not be executed. The default implementation of this method just returns a false value.

wsgiref.handlers.BaseHandler.run()

run(app) Run the specified WSGI application, app.

wsgiref.handlers.BaseHandler.os_environ

os_environ The default environment variables to be included in every request’s WSGI environment. By default, this is a copy of os.environ at the time that wsgiref.handlers was imported, but subclasses can either create their own at the class or instance level. Note that the dictionary should be considered read-only, since the default value is shared between multiple classes and instances.

wsgiref.handlers.BaseHandler.origin_server

origin_server This attribute should be set to a true value if the handler’s _write() and _flush() are being used to communicate directly to the client, rather than via a CGI-like gateway protocol that wants the HTTP status in a special Status: header. This attribute’s default value is true in BaseHandler, but false in BaseCGIHandler and CGIHandler.

wsgiref.handlers.BaseHandler.log_exception()

log_exception(exc_info) Log the exc_info tuple in the server log. exc_info is a (type, value, traceback) tuple. The default implementation simply writes the traceback to the request’s wsgi.errors stream and flushes it. Subclasses can override this method to change the format or retarget the output, mail the traceback to an administrator, or whatever other action may be deemed suitable.

wsgiref.handlers.BaseHandler.http_version

http_version If origin_server is true, this string attribute is used to set the HTTP version of the response set to the client. It defaults to "1.0".

wsgiref.handlers.BaseHandler.get_stdin()

get_stdin() Return an input stream object suitable for use as the wsgi.input of the request currently being processed.

wsgiref.handlers.BaseHandler.get_stderr()

get_stderr() Return an output stream object suitable for use as the wsgi.errors of the request currently being processed.

wsgiref.handlers.BaseHandler.get_scheme()

get_scheme() Return the URL scheme being used for the current request. The default implementation uses the guess_scheme() function from wsgiref.util to guess whether the scheme should be “http” or “https”, based on the current request’s environ variables.

wsgiref.handlers.BaseHandler.error_status

error_status The HTTP status used for error responses. This should be a status string as defined in PEP 3333; it defaults to a 500 code and message.