Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.3K
Views
Django: NOT Null constraint failed for SQLIte

Below are my models. I am keep getting error when running python manage.py migrate

django.db.utils.IntegrityError: NOT NULL constraint failed: app_project.description

Models given below:

from django.db import models


# Create your models here.

class Project(models.Model):
    title = models.CharField(max_length=100)
    description = models.TextField(max_length=2000, blank=True, default='')
    progress = models.FloatField(default=0)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self):
        return self.title


class Task(models.Model):
    project = models.ForeignKey(Project, on_delete=models.CASCADE)
    title = models.CharField(max_length=100)
    severity = models.SmallIntegerField(default=0)
    open_date = models.DateTimeField()
    close_date = models.DateTimeField()
    status = models.SmallIntegerField(default=0)

    def __str__(self):
        return self.title

I am on Django 1.10

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Change to:

description = models.TextField(max_length=2000, blank=True, null=True, default='')

in order to allow nullable values inside the db.

See the difference between null and blank here and here.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!