Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 52b93fec02
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 24 lines (19 sloc) 0.751 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
from pyramid.config import Configurator
from pyramid.authentication import AuthTktAuthenticationPolicy
from cluegun.models import appmaker

from pyramid_zodbconn import get_connection

def root_factory(request):
    conn = get_connection(request)
    return appmaker(conn.root())

def main(global_config, **settings):
    passwd_file = settings.get('password_file', None)
    if passwd_file is None:
        raise ValueError('password_file must not be None')
    config = Configurator(
        root_factory = root_factory,
        settings = settings,
        authentication_policy = AuthTktAuthenticationPolicy('seekrit'),
        )
    config.add_static_view('static', 'cluegun:static')
    config.scan('cluegun')
    return config.make_wsgi_app()

Something went wrong with that request. Please try again.