[Answered ]-Django AttributeError: type object 'Admin' has no attribute '_meta' error when creating custom user

1๐Ÿ‘

โœ…

I think that the problem is in your admin.py.
admin.site.register takes a BaseModel instance and ModelAdmin instance.
Try to change

admin.site.register(Admin, AdminModelAdmin)

to

admin.site.register(Customer, AdminModelAdmin)

Change Customer to needed user model.

Or maybe you wanted to make specific model for admin users, but used wrong parent class, since admin.ModelAdmin is not a model. So if you want to have a Admin as a model, change parent to AbstractBaseUser, but this is generally a better idea to have a single AbstractBaseUser.

๐Ÿ‘คCOSHW

Leave a comment