As explained in documentation, on_delete argument in models.ForeignKey() will become required starting from Django 2.0. Since Django 1.9 and higher thrown a warning when it is missing, it should be always set.
Note: on Django 1.11, warning is visible only with -W command line argument. Example: python -Wd manage.py runserver
When the argument is omitted, the default value is CASCADE. So it is safe to set this value to models.CASCADE.
As explained in documentation,
on_delete
argument inmodels.ForeignKey()
will become required starting from Django 2.0. Since Django 1.9 and higher thrown a warning when it is missing, it should be always set. Note: on Django 1.11, warning is visible only with -W command line argument. Example:python -Wd manage.py runserver
When the argument is omitted, the default value is
CASCADE
. So it is safe to set this value tomodels.CASCADE
.