pyramid_cubicweb/init_instance.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Wed, 29 Apr 2015 11:39:35 +0200
changeset 11563 f9473eb6a8a9
parent 11492 b0b8942cdb80
permissions -rw-r--r--
Make debug mode usable without pyramid_debugtoolbar Add the latter in Debian recommends along the way. Closes #5310434.

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