How to have a Custom User model for my app while keeping the admins working as default in Django?
<p>Here is what I am trying to accomplish: <br/></p>

<p>  - Have admins login to the admin page using the default way (username and password).</p>

<p> - Have users register/login to my web app using a custom User Model which uses email instead of password. They can also have other data associated that I don't need for my admins.</p>

<p> - Separate the admin accounts and user accounts into different tables. </p>

<p></p>

<p>I checked how to create a Custom User class by extending AbstracBaseUser, but the result I got is that my admins also became the new user type. So can I have the Custom User model be used for my app users while keeping the default admin system untouched? Or what is a good alternative to my design?</p>

<p>The recommended Django practice is to create a OneToOne field pointing to the User, rather than extending the User object - this way you build on top of Django's User by decorating only the needed new model properties (for example):</p>

<pre><code>class Profile(models.Model):
    user = models.OneToOneField(User,parent_link=True,blank=True,null=True)
    profile_image_path =  models.CharField(max_length=250,blank=True, null=True)
    phone = models.CharField(max_length=250,blank=True, null=True)
    address = models.ForeignKey(Address,blank=True,null=True)
    is_admin = models.NullBooleanField(default=False,blank=True,null=True)

    class Meta:
       verbose_name = 'Profile'
       verbose_name_plural = 'Profiles'
</code></pre>

python django