How to Fix “missing 1 required positional argument: on_delete”

Video is ready, Click Here to View ×


I really like the new path method so I decided to check out Django 2.0. Among the new feature there are some minor changes such as with the ForeignKey field.ForeignKey is a Django field for defining a many-to-one relationship.

Up until Django 1.9 the ForeignKey field required a single argument: the model to map to.

Since Django 2.0 the ForeignKey field requires two positional arguments:

the model to map to
the on_delete argument

For a quick fix you can find the instruction in the video.

Be the first to comment

Leave a Reply

Your email address will not be published.


*