websauna.system.core.simpleroute module

Adaption of tomb_routes.

This code is adoption of tomb_routes https://github.com/TombProject/tomb_routes created by John Anderson.

websauna.system.core.simpleroute.add_simple_route(config, path, target, append_slash=False, *args, **kwargs)[source]

Configuration directive that can be used to register a simple route to a view.

Examples:

with view callable:

config.add_simple_route(
    '/path/to/view', view_callable,
    renderer='json'
)

with dotted path to view callable:

config.add_simple_route(
    '/path/to/view', 'dotted.path.to.view_callable',
    renderer='json'
)
websauna.system.core.simpleroute.includeme(config)[source]

Function that gets called when client code calls config.include