You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
732 B
23 lines
732 B
from pyramid.config import Configurator |
|
from pyramid_zodbconn import get_connection |
|
from .models import appmaker |
|
|
|
|
|
def root_factory(request): |
|
conn = get_connection(request) |
|
return appmaker(conn.root()) |
|
|
|
|
|
def main(global_config, **settings): |
|
""" This function returns a Pyramid WSGI application. |
|
""" |
|
with Configurator(settings=settings) as config: |
|
settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
|
config.include('pyramid_tm') |
|
config.include('pyramid_retry') |
|
config.include('pyramid_zodbconn') |
|
config.set_root_factory(root_factory) |
|
config.include('pyramid_jinja2') |
|
config.include('.routes') |
|
config.scan() |
|
return config.make_wsgi_app()
|
|
|