cubicweb/pyramid/__init__.py
changeset 12771 70597b447fb7
parent 12762 f14dde905818
child 12782 ea8801f10a72
--- a/cubicweb/pyramid/__init__.py	Wed Sep 25 05:42:47 2019 +0200
+++ b/cubicweb/pyramid/__init__.py	Tue Oct 08 22:14:06 2019 +0200
@@ -28,6 +28,8 @@
 import wsgicors
 
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
+from cubicweb.pyramid.debug_source_code import debug_display_source_code, DEBUG_DISPLAY_SOURCE_CODE_PATH
+
 from pyramid.config import Configurator
 from pyramid.exceptions import ConfigurationError
 from pyramid.settings import asbool, aslist
@@ -109,6 +111,11 @@
         config.add_route('profile_ping', '_profile/ping')
         config.add_route('profile_cnx', '_profile/cnx')
         config.scan('cubicweb.pyramid.profile')
+
+    if debugtoolbar:
+        config.add_route('debug_display_source_code', DEBUG_DISPLAY_SOURCE_CODE_PATH)
+        config.add_view(debug_display_source_code, route_name='debug_display_source_code')
+
     app = config.make_wsgi_app()
     # This replaces completely web/cors.py, which is not used by
     # cubicweb.pyramid anymore