I am working on my Final Year Project. I wanted to extend the default User model that Django provides in order to add some more attributes. I added following code in my models.py
class User(AbstractUser):
contact = models.CharField(max_length=100)
Also in settings.py
I added:
AUTH_USER_MODEL = 'esacp.User'
where esacp
is the name of my app.
After doing all of this, I ran python manage.py makemigrations esacp
, then I ran python manage.py migrate
in my Windows Command Prompt. Both of these commands worked perfectly.
Now, I went to create an admin role for my Django Web App, in order to manage the things as a superuser, when I ran the command python manage.py createsuperuser
, it asked me for the username, after I entered username and pressed 'Enter', it gave me the error:
django.db.utils.OperationalError: no such table: esacp_user
A screenshot of the whole error:
Where did I make a mistake or miss anything?