Skip to content
Advertisement

Tag: django-2.0

Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries

I have two classes in my sqlite database, a parent table named Categorie and the child table called Article. I created first the child table class and addes entries. So first I had this: And after I have added parent table, and now my models.py looks like this: So when I run python manage.py makemigrations <my_app_name>, I get this error:

Advertisement