pyramid_cubicweb/__init__.py
changeset 11563 f9473eb6a8a9
parent 11550 38ed4c3ac3de
child 11564 a6547ff97ce0
--- a/pyramid_cubicweb/__init__.py	Thu Feb 26 00:56:32 2015 +0100
+++ b/pyramid_cubicweb/__init__.py	Wed Apr 29 11:39:35 2015 +0200
@@ -1,4 +1,5 @@
 import os
+from warnings import warn
 import wsgicors
 
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
@@ -43,7 +44,11 @@
 
     config = Configurator(settings=settings)
     if cwconfig.debugmode:
-        config.include('pyramid_debugtoolbar')
+        try:
+            config.include('pyramid_debugtoolbar')
+        except ImportError:
+            warn('pyramid_debugtoolbar package not available, install it to '
+                 'get UI debug features', RuntimeWarning)
     config.registry['cubicweb.config'] = cwconfig
     config.registry['cubicweb.repository'] = repo = cwconfig.repository()
     config.registry['cubicweb.registry'] = repo.vreg