|
|
|
from pyramid.config import Configurator
|
|
|
|
from pyramid.session import SignedCookieSessionFactory
|
|
|
|
|
|
|
|
|
|
|
|
__version__ = '0.0.1'
|
|
|
|
|
|
|
|
|
|
|
|
def main(global_config, **settings):
|
|
|
|
''' This function returns a Pyramid WSGI application. '''
|
|
|
|
config = Configurator(settings=settings)
|
|
|
|
|
|
|
|
session_factory = SignedCookieSessionFactory(settings['session.secret'])
|
|
|
|
config.set_session_factory(session_factory)
|
|
|
|
config.set_default_csrf_options(require_csrf=settings['session.auto_csrf'])
|
|
|
|
|
|
|
|
config.include('pyramid_jinja2')
|
|
|
|
config.include('.models')
|
|
|
|
config.include('.resources')
|
|
|
|
config.include('.schemas')
|
|
|
|
config.include('.security')
|
|
|
|
config.include('.views')
|
|
|
|
|
|
|
|
config.scan()
|
|
|
|
|
|
|
|
return config.make_wsgi_app()
|