Django isn't creating db constraints for foreign keys with SQLite
问题 I'm using Django 3.0.6 I'm adding ForeignKey and ManyToManyField to my models, but I've noticed that django creates the INDEX , but not the actual FOREIGN KEY constraints in the db. I've tried to explicitly set db_constraint=True but as expected is useless, since it's True by default. I've found so many answers explaining this, but only for very old Django versions, doing tricks for enabling it when it was otherwise disabled. Now instead it should just work out of the box. Couldn't find