cubicweb/pyramid/__init__.py
changeset 12771 70597b447fb7
parent 12762 f14dde905818
child 12782 ea8801f10a72
equal deleted inserted replaced
12770:be0864a2eec8 12771:70597b447fb7
    26 import warnings
    26 import warnings
    27 
    27 
    28 import wsgicors
    28 import wsgicors
    29 
    29 
    30 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
    30 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
       
    31 from cubicweb.pyramid.debug_source_code import debug_display_source_code, DEBUG_DISPLAY_SOURCE_CODE_PATH
       
    32 
    31 from pyramid.config import Configurator
    33 from pyramid.config import Configurator
    32 from pyramid.exceptions import ConfigurationError
    34 from pyramid.exceptions import ConfigurationError
    33 from pyramid.settings import asbool, aslist
    35 from pyramid.settings import asbool, aslist
    34 
    36 
    35 
    37 
   107         'cubicweb.profile.enable', False))
   109         'cubicweb.profile.enable', False))
   108     if profile:
   110     if profile:
   109         config.add_route('profile_ping', '_profile/ping')
   111         config.add_route('profile_ping', '_profile/ping')
   110         config.add_route('profile_cnx', '_profile/cnx')
   112         config.add_route('profile_cnx', '_profile/cnx')
   111         config.scan('cubicweb.pyramid.profile')
   113         config.scan('cubicweb.pyramid.profile')
       
   114 
       
   115     if debugtoolbar:
       
   116         config.add_route('debug_display_source_code', DEBUG_DISPLAY_SOURCE_CODE_PATH)
       
   117         config.add_view(debug_display_source_code, route_name='debug_display_source_code')
       
   118 
   112     app = config.make_wsgi_app()
   119     app = config.make_wsgi_app()
   113     # This replaces completely web/cors.py, which is not used by
   120     # This replaces completely web/cors.py, which is not used by
   114     # cubicweb.pyramid anymore
   121     # cubicweb.pyramid anymore
   115     app = wsgicors.CORS(
   122     app = wsgicors.CORS(
   116         app,
   123         app,