def main(global_config, **settings):
    """Main WSGI application factory."""
    initialize_sentry_integration()
    config = Configurator(settings=settings)
    declare_api_routes(config)
    declare_type_info(config)

    # allowing the pyramid templates to render rss and xml
    config.include('pyramid_jinja2')
    config.add_jinja2_renderer('.rss')
    config.add_jinja2_renderer('.xml')

    mandatory_settings = ['exports-directories', 'exports-allowable-types']
    for setting in mandatory_settings:
        if not settings.get(setting, None):
            raise ValueError('Missing {} config setting.'.format(setting))

    config.scan(ignore='.tests')
    config.include('cnxarchive.events.main')

    config.add_tween('cnxarchive.tweens.conditional_http_tween_factory')

    return config.make_wsgi_app()
def main ( global_config , ** settings ) : initialize_sentry_integration ( ) config = Configurator ( settings = settings ) declare_api_routes ( config ) declare_type_info ( config ) config . include ( 'pyramid_jinja2' ) config . add_jinja2_renderer ( '.rss' ) config . add_jinja2_renderer ( '.xml' ) mandatory_settings = [ 'exports-directories' , 'exports-allowable-types' ] for setting in mandatory_settings : if not settings . get ( setting , None ) : raise ValueError ( 'Missing {} config setting.' . format ( setting ) ) config . scan ( ignore = '.tests' ) config . include ( 'cnxarchive.events.main' ) config . add_tween ( 'cnxarchive.tweens.conditional_http_tween_factory' ) return config . make_wsgi_app ( )
Main WSGI application factory.