AttributeError: Manager isn't available; ' auth.User' has been swapped for 'account.UserInfo'
This is because I have extended Django’s user authentication model
#setting.py
AUTH_USER_MODEL = 'account.UserInfo'
Official documents
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
User = get_user_model()
Or use the user info model directly
""" get_user_model"""
def get_user_model():
"""
Return the User model that is active in this project.
"""
try:
return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
except ValueError:
raise ImproperlyConfigured("AUTH_USER_MODEL must be of the form 'app_label.model_name'")
except LookupError:
raise ImproperlyConfigured(
"AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
)
Read More:
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] YOLO v5 Error: AttributeError: Can‘t get attribute SPPF on module models
- AttributeError: can‘t set attribute [How to Solve]
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- [Solved] AttributeError: ‘DataParallel‘ object has no attribute ‘save‘
- [Solved] AttributeError: ‘_IncompatibleKeys’ object has no attribute
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- AttributeError str object has no attribut [How to Solve]
- [Solved] django AttributeError: ‘UserComment‘ object has no attribute ‘save‘
- [Solved] Pycharm error: attributeerror: ‘Htmlparser’ object has no attribute ‘unescape’
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [Solved] AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘parameters‘
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] AttributeError WriteOnlyWorksheet object has no attribute cell
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]