Why my code is not encrypting the password if i inherit django user?
<p>Im learning about django, and i need create a customized user, called Person. I  use inherit from contrib.auth.models User, but in my django administrator the form for add a new Teacher dont show the field confirm password and the password is not encrypted in the table user</p>

<pre><code>from django.db import models
from django.contrib.auth.models import User, UserManager

# Create your models here.


class Person (User):

    date_of_birth = models.DateField(blank=False, null=False)

    class Meta:
        abstract = True


class ClassRoom (models.Model):
    classroom = models.CharField(max_length=3, blank=False, null=False)

    def __unicode__(self):
        return self.classroom


class Teacher(Person):
    phone = models.PositiveIntegerField(max_length=15, blank=False, null=False)
    classroom = models.ManyToManyField(ClassRoom)
</code></pre>

<p>You can see in this photo as the first and second users is saved encripting the password(this users was added as normal user in the django administrator), but the last(creadted as Teacher in the django administrator) dont encrypt the pass.</p>

<p>Â¿Someone can help me?
<a href="http://i.stack.imgur.com/zN9jU.png" rel="nofollow">database photo user table</a></p>

<p>In order to encrypt a password, you need to set it through User's <code>set_password</code> method. for example, </p>

<pre><code>user = User(
            email=email, is_staff=False, is_active=True,
            is_superuser=False,
            last_login=now, date_joined=now, **extra_fields)

user.set_password(password)
user.save(using=self._db)
</code></pre>

python django django-models django-views