Skip to content
Advertisement

SQLite3 Integrity Error When Running “createsuperuser”

I am trying to extend the default Django User model by linking to it through a OneToOneField.

I successfully migrated the changes and registered my Profile model inside admin.py, however, when I try to run the command python manage.py createsuperuser and fill in the information I get an Integrity Error.

JavaScript

I know what the issue is. I have a field called date_of_birth which is required, and I can’t leave it blank, that raises the exception.

I want a simple solution, but couldn’t think of one, and I don’t want to add a bunch of blank=True snippets to all of my required fields.

Here’s my code.

  • models.py
JavaScript
  • signals.py
JavaScript

Advertisement

Answer

I have solved this by providing a default value for the date_of_birth field.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement