cubicweb/pyramid/init_instance.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Fri, 18 Nov 2016 14:26:03 +0100
branch3.24
changeset 11833 1212f0fa2d42
parent 11631 faf279e33298
permissions -rw-r--r--
[debian] Have a single python-cubicweb binary for the library But keep distinct meta-packages for dependencies of the HTTP server (Twisted/Pyramid) and database backend. Related to #16133259.

from cubicweb.cwconfig import CubicWebConfiguration


def includeme(config):
    appid = config.registry.settings['cubicweb.instance']
    cwconfig = CubicWebConfiguration.config_for(appid)

    config.registry['cubicweb.config'] = cwconfig
    config.registry['cubicweb.repository'] = repo = cwconfig.repository()
    config.registry['cubicweb.registry'] = repo.vreg