drakken.core module¶
Routing module.
- class drakken.core.Blueprint(name, url_prefix='')¶
Bases:
object
A container for storing related page handlers.
Allows you to divide an app into logical components: an accounts blueprint, a documents blueprint, etc.
- Parameters:
name (str) – blueprint name.
url_prefix (str) – URL prefix.
- route(path, name='')¶
Decorator to store route.
- Parameters:
path (str) – URL path.
name (str) – route name, optional.
- Raises:
AssertionError – Route already exists in the blueprint.
- class drakken.core.Drakken¶
Bases:
object
The Drakken Application class.
- __init__()¶
Initialize Drakken application.
- add_middleware(middleware)¶
Add middleware.
- Parameters:
middleware (Middleware) – Middleware object.
- handle_request(request)¶
Find and execute the handler for this request.
- Parameters:
request (message.Request) – Request object.
- Returns:
message.Response object.
- register_blueprint(blueprint)¶
Store blueprint.
- Parameters:
blueprint (Blueprint) – a Blueprint object.
- route(path, name='')¶
Decorator to store route.
- Parameters:
path (str) – URL path.
name (str) – route name, optional.
- Raises:
AssertionError – Route already exists.
- runserver()¶
Run development server forever.