cubicweb/pyramid/core.py
branch3.26
changeset 12349 7e670235174f
parent 12225 a8ed10f80a85
child 12379 04348101688a
child 12432 2fcb53ee5178
--- a/cubicweb/pyramid/core.py	Wed Aug 22 16:04:39 2018 +0200
+++ b/cubicweb/pyramid/core.py	Fri Aug 24 17:19:02 2018 +0200
@@ -413,8 +413,12 @@
 
     cwcfg = config.registry['cubicweb.config']
     for cube in cwcfg.cubes():
-        pkgname = 'cubes.' + cube
-        mod = __import__(pkgname)
-        mod = getattr(mod, cube)
+        try:
+            pkgname = 'cubicweb_{}'.format(cube)
+            mod = __import__(pkgname)
+        except ImportError:
+            pkgname = 'cubes.{}'.format(cube)
+            mod = __import__(pkgname)
+            mod = getattr(mod, cube)
         if hasattr(mod, 'includeme'):
-            config.include('cubes.' + cube)
+            config.include(pkgname)