sometimes the reason for this error was sending arguments to the registration function in the wrong order.
Check the registration order of ModelAdmin: first its model class, then the ModelAdmin class.
Example: admin.site.register (Model, ModelAdmin)
I suppose, naturally, the second should be ModelAdmin, since the register (MyModel) also works.
source share