cubicweb/pyramid/core.py
changeset 12379 04348101688a
parent 12355 c703dc95c82e
parent 12349 7e670235174f
child 12491 540904e0ff0f
--- a/cubicweb/pyramid/core.py	Fri Feb 22 15:48:34 2019 +0100
+++ b/cubicweb/pyramid/core.py	Wed Feb 27 13:36:31 2019 +0100
@@ -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)