Request handler

class supercell.requesthandler.RequestHandler(application, request, **kwargs)

supercell request handler.

The only difference to the tornado.web.RequestHandler is an adopted RequestHandler._execute() method that will handle the consuming and providing of request inputs and results.

config

Convinience method for accessing the environment.

decode_argument(value, name=None)

Overwrite the default RequestHandler.decode_argument() method in order to allow latin1 encoded URLs.

environment

Convinience method for accessing the environment.

get_template(model)

Method to determine which template to use for rendering the html.

logger

Use this property to write to the log files.

In a request handler you would simply log messages like this:

def get(self):
    self.logger.info('A test')
prepare(*args, **kwargs)

Check for a consumer and optionally add the cache headers.

note:: when overriding the prepare() method, don’t forget to call
the super method.
request_id

Return a unique id per request. Collisions are allowed but should should not occur within a 10 minutes time window.

The current implementation is based on a timestamp in milliseconds substracted by a large number to make the id smaller.

Read the Docs v: latest
Versions
latest
v0.4.0
v0.3.0
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.