velruse.app

default_setup(config)[source]

Configure Velruse’s session factory and backend storage.

The default setup uses Pyramid’s UnencryptedCookieSessionFactoryConfig for storing session data.

Relevant settings:

session.secret controls the secret used when signing the session cookies and will be randomly generated if unspecified.

session.cookie_name is the name of the cookie stored on a client’s browser and will default to ‘velruse.session’.

store.* settings are used by the anykeystore library to construct a storage backend for user credentials. If no storage settings are specified then an in-memory storage backend will be used.

register_velruse_store(config, storage)[source]

Add key/value store for Velruse to the Pyramid application.

This function is registered with Pyramid and can be used via config.register_velruse_store(storage).

storage should be an instance of an anykeystore backend.

make_app(global_conf, **settings)[source]

Construct a complete WSGI app.

This function is compatible with the PasteDeploy WSGI application factory API, which is also used by Pyramid’s pserve script.

Example INI file:

[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 80

[composite:main]
use = egg:Paste#urlmap
/ = YOURAPP
/velruse = velruse

[app:velruse]
use = egg:velruse

setup = myapp.setup_velruse

endpoint = http://example.com/logged_in

store = redis
store.host = localhost
store.port = 6379
store.db = 0
store.key_prefix = velruse_ustore

provider.facebook.consumer_key = KMfXjzsA2qVUcnnRn3vpnwWZ2pwPRFZdb
provider.facebook.consumer_secret =
    ULZ6PkJbsqw2GxZWCIbOEBZdkrb9XwgXNjRy
provider.facebook.scope = email

provider.tw.impl = twitter
provider.tw.consumer_key = ULZ6PkJbsqw2GxZWCIbOEBZdkrb9XwgXNjRy
provider.tw.consumer_secret = eoCrFwnpBWXjbim5dyG6EP7HzjhQzFsMAcQOEK

[app:YOURAPP]
use = egg:YOURAPP
full_stack = true
static_files = true