examples.sample_routes package#

Subpackages#

Submodules#

examples.sample_routes.app module#

class examples.sample_routes.app.SampleClassView#

Bases: BaseView

Sample class-based view with two methods implemented.

get(request, response, **kwargs)#

GET HTTP method handler.

It should be overridden in subclasses to enable support for the GET HTTP method.

Parameters:
  • request (Request) – The request.

  • response (Response) – The response.

  • kwargs (dict) – The route parameters.

post(request, response, **kwargs)#

POST HTTP method handler.

It should be overridden in subclasses to enable support for the POST HTTP method.

Parameters:
  • request (Request) – The request.

  • response (Response) – The response.

  • kwargs (dict) – The route parameters.

examples.sample_routes.app.add(_, response, first_number, second_number)#

Sample route with a dynamic parameters that of which sum will be rendered.

examples.sample_routes.app.external(_, response)#

Sample route that is defined outside of the app and is added to the router later.

examples.sample_routes.app.hello(_, response, name)#

Sample route with a dynamic parameter that will be used to render the page.

examples.sample_routes.app.home(_, response)#

Sample template route. It will render a page using predefined template.

examples.sample_routes.app.limited_view(request, response)#

Sample route with supported methods specified.

examples.sample_routes.app.text(_, response)#

The home route. It renders a page with a sample text.

Module contents#