Constraint Error.

I followed your steps for updating the model with the SlugField , but kept getting a UNIQUE constraint failed error, so i wrote this workaround.

Field.unique
If True, this field must be unique throughout the table.

This is enforced at the database level and by model validation. If you try to save a model with a duplicate value in a unique field, a django .db.IntegrityError will be raised by the model’s save() method.

Hope this helps, sorry for long text.