pywebtools.pyramid.auth – Authentication Framework for Pyramid + SQLAlchemy

The pywebtools.pyramid.auth module provides an authentication framework for use with Pyramid and SQLAlchemy. It provides a User model plus all the views needed to handle registration, login, logout, and password retrieval. The workflow that it implements is registration -> confirmation via e-mail -> password reset -> login -> forgotten password -> password reset.

The framework is configurable via the parameters passed to the init() function.

pywebtools.pyramid.auth.init(config, renderers=None, urls=None, redirects=None, callbacks=None)

Initialises the authentication framework.

Routes that can have renderers attached via renderers`, redirects via ``redirects, and can have their URLs changed via urls:

If no renderer is provided for a route, then the route will not be registered.

The following callbacks can be registered via callbacks:

  • config (Configurator) – The Pyramid configuration object to use to set up the configuration
  • renderers (dict) – Renderers to attach to the available views
  • urls (dict) – Alternative URLs to use
  • redirects (dict) – Redirect routes that are used after any request has been completed
  • callbacks (dict) – Callbacks that are called for certain actions on the user