Checks if user is accessing protected resource is authenticated and optionally in one of allowed roles.
roles - a list of authorized roles.
Check if call is authenticated:
class MyHandler(BaseHandler):
@authorize
def get(self):
return response
Check if principal in role:
class MyHandler(BaseHandler):
@authorize(roles=('operator', 'manager'))
def get(self):
return response
Checks if user is accessing protected resource via SSL and if not, issue permanent redirect to HTTPS location.
enabled - whenever to do any checks (defaults to True).
Example:
class MyHandler(BaseHandler):
@secure
def get(self):
...
return response
Using enabled:
class MyHandler(BaseHandler):
@secure(enabled=False)
def get(self):
...
return response
caching module.
Integration with Mako templates.
transforms module
handlers package.
Provides methods that integrate such features like: routing, i18n, model binding, template rendering, authentication, xsrf/resubmission protection.
You need inherit this class and define get() and/or post() to be able respond to HTTP requests.
Performs permanent redirect (HTTP status code 301) to given route name.
Redirects to given route name (HTTP status code 302).
Represents the most generic handler. It serves dispatcher purpose for HTTP request method (GET, POST, etc). Base class for all handlers.
T.__new__(S, ...) -> a new object with type S, a subtype of T
middleware package.