Tag
Oct 31, 2020 · 1 min read · Ritij Jain
Django adds an auto-incrementing id field when a model has no explicit primary key. A lookup such as get object or 404(MyModel, pk=1) looks for the row whose primary key is 1 . It returns a 404 if tha…