ForeignKey.on_delete
When an object referenced by a ForeignKey is deleted, Django will emulate the behavior of the SQL constraint specified by the on_delete argument. For example, if you have a nullable ForeignKey and you want it to be set null when the referenced object is deleted:
user = models.ForeignKey(
User,
models.SET_NULL,
blank=True,
null=True,
)
Deprecated since version 1.9: on_delete will become a required argument in Django 2.0. In older versions it defaults to