23👍
✅
An alternative to removing the password field would be to use set_unusable_password
, which marks the user as having no password set.
def create_user(phone, name=None):
user = User(name=name, phone=phone)
user.set_unusable_password()
user.save()
return user
- Django: check for modeladmin for a given model
- Django – inline – Search for existing record instead of adding a new one
- Mysql_exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
Source:stackexchange.com