[Answer]-Uniqify Django models with a unique attribute instead of using PK


Try dropping and recreating your database. The unique constraint will not be updated in database, if you add it after creating the database tables. If you don’t want to lose your data, you need to add the property manually in the database.


Leave a comment