pyramid_cubicweb/init_instance.py
author Christophe de Vienne <christophe@unlish.com>
Mon, 06 Jul 2015 13:17:07 +0200
changeset 11585 7d6d4edc0ed0
parent 11492 b0b8942cdb80
permissions -rw-r--r--
[doc] Anonymous access is not mandatory anymore

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