1👍
✅
When you define objects
in your User model you should give it a type like this:
class User(AbstractBaseUser):
...
objects: UserManager = UserManager()
0👍
Try this:
from django.contrib.auth.models import User, AbstractUser
from django.contrib.auth import get_user_model
# import of `UserManager`
user_manager: UserManager = get_user_model().objects
user_manager.create_user(**user_data)
- [Answered ]-Django relay filter not working for foreign key field
- [Answered ]-How would you allow users to extend off a Django site for templating purposes?
- [Answered ]-Elastic Beanstalk failed to update local Git configuration
- [Answered ]-Django south: problems with path to django
Source:stackexchange.com