Fixing error "Badly formed hexadecimal UUID string" after converting existing id to uuid in Django (Django 3.0)
Before everything, double check that you don't have any foreign key with Cascade uppon this model. Then, instead of changing the type of id = models.IntegerField() :

create a new field uuid = models.UUIDField(default=uuid.uuid4, primary=True) (default will set the field for existing rows)
make migrations
remove the id field
make migrations
rename the uuid field to id
make migrations
migrate

However, you should know that removing the id field, and / or naming the uuid is not mandatory, and it's often a good idea to keep both.
I created a table with an initial IntegerField primary key and later changed the id to a UUIDField. Now this raises a "Badly formed hexadecimal UUID string", I guess because a number such as "1" isn't a valid UUID value. Does anyone know a concise way to fix this in code when updating the models.py file for the django app?