equal
deleted
inserted
replaced
|
1 import os |
|
2 |
|
3 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg |
1 from pyramid.config import Configurator |
4 from pyramid.config import Configurator |
2 |
5 |
3 |
6 |
4 def make_cubicweb_application(cwconfig): |
7 def make_cubicweb_application(cwconfig): |
5 """ |
8 """ |
24 config.registry['cubicweb.registry'] = repo.vreg |
27 config.registry['cubicweb.registry'] = repo.vreg |
25 config.include('pyramid_cubicweb.defaults') |
28 config.include('pyramid_cubicweb.defaults') |
26 config.include('pyramid_cubicweb.core') |
29 config.include('pyramid_cubicweb.core') |
27 config.include('pyramid_cubicweb.bwcompat') |
30 config.include('pyramid_cubicweb.bwcompat') |
28 return config |
31 return config |
|
32 |
|
33 |
|
34 def wsgi_application(instance_name=None, debug=None): |
|
35 if instance_name is None: |
|
36 instance_name = os.environ.get('CW_INSTANCE') |
|
37 if debug is None: |
|
38 debug = 'CW_DEBUG' in os.environ |
|
39 |
|
40 cwconfig = cwcfg.config_for(instance_name, debugmode=debug) |
|
41 config = make_cubicweb_application(cwconfig) |
|
42 return config.make_wsgi_app() |