Search code examples
pythonurlpylonspyramidakhet

How to generate an URL with Pyramid and Akhet?


I'm creating an Akhet (Pyramid) web application. How can one generate in a mako template the URL for a given Handler/view ?

I'm looking for the equivalent of Pylons' ${url(controller="users", view="list")


Solution

  • Akhet exposes the URLGenerator object as a renderer global, so you can just use url('users', action='list'), assuming config.add_handler('users', '/users/{action}', ...) in your setup.

    http://docs.pylonsproject.org/projects/akhet/dev/api.html#module-akhet.urlgenerator