bag.web.pyramid.routes module

Make Pyramid routes and the route_path() function available to JS.

…in the client, under the name “jurl()”.

bag.web.pyramid.routes.routes_as_json(config, base_path='/')[source]
bag.web.pyramid.routes.treated_routes(config, base_path='/')[source]

A dict containing each of the routes configured in this application.

In your app configuration, config.make_wsgi_app() must be called before routes are extracted:

app = config.make_wsgi_app()
config.registry.app_routes = treated_routes(config)
return app

The return value is a dict like this:

{'__static': '/static',  # static routes start with "__"
 'activate': '/activate/{user_id}/{code}'}
bag.web.pyramid.routes.write_routes_js_file(config, file_path, base_path='/')[source]