From the Django.Contrib.Auth docs:
Extending Django’s default User If you’re entirely happy with Django’s User model and you just want to add some additional profile information, you can simply subclass
django.contrib.auth.models.AbstractUser
and add your custom profile fields. This class provides the full implementation of the default User as an abstract model.
Said and done. I created a new model like below:
class MyUser(AbstractUser):
some_extra_data = models.CharField(max_length=100, blank=True)
This shows up in admin almost like Django's standard User
. However, the most important difference in admin is that the password-(re)set field is not present, but a normal CharField is displayed instead. Do I really have to override stuff in the admin-config to get this to work? If so, how can I do that in somewhat DRY way (i.e. without copying stuff from the Django source... eww...)?