Add extra fields in custom user model using AbstractUser

In models.py

from django.contrib.auth.models import AbstractUser
from django.db import models


class CustomUser(AbstractUser):
date_of_birth = models.DateField(null=True, blank=True)
address = models.CharField(max_length=200)
bio_info = models.TextField(max_length=200)

settings.py

AUTH_USER_MODEL = 'myapp.CustomUser' 

No comments

Powered by Blogger.