0

It is impossible to add a non-nullable field 'id' to client without specifying a default. This is because the database needs something to populate existing rows. Please select a fix:

  1. Provide a one-off default now (will be set on all existing rows with a null value for this column)
  2. Quit and manually define a default value in models.py.

models.py

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

class Client(AbstractBaseUser):

    username = models.CharField(max_length=200)
    password = models.CharField(max_length=200, default="")
    
    def __str__(self):
        return self.username
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 02 '23 at 16:21

0 Answers0