Open pavelber opened 6 years ago
I am seeing the same problem.
Where did you define your crud config classes?
crud
(yourapp/crud.py)settings.INSTALLED_APPS
I know this is closed, but the solution didn't solve the problem for me. I've checked that my app is in settings.INSTALLED_APPS
and I've created my CRUD classes in myapp/crud.py
. Anything else I should check?
Digging into crudbuilder's source code, I think I found a possible cause. Apparently when using the Application Configuration features (see this SO post), crudbuilder can't find the app's path (in crudbuilder.registry.import_crud(app)
.
In my case, instead of declaring the raw name for my app (e.g. myapp
) in INSTALLED_APPS
, I have myapp.apps.MyappConfig
(the default created by django 1.11 when following the tutorial). In other words:
INSTALLED_APPS = [
# 'myapp', # I think this is what CRUDbuilder is expecting
'myapp.apps.MyappConfig', # This is what django automatically generates, but crudbuilder can't find the path in this case
...
]
If I use the raw app name instead of the autogenerated line, then I see the registered cruds. It seems to me that, since the Application Configuration feature seems to be the prefered way to declare apps, crudbuilder should add support for this feature as well.
I tried to resemble your example with Person and PersonCrud but I get empty registered cruds list.
Should I explicitly register a crud in some way?