Skip to content Skip to sidebar Skip to footer

Django Uuidfield Modelfield Causes Error In Django Admin: Badly Formed Hexadecimal Uuid String

I have a Django 1.8 project and on one of my models, I am using the new UUIDField like so: class MyModel(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uui

Solution 1:

The problem is that I had an existing record in the DB with a default integer autoincrement id, before I had specific that the id field on my model was a UUIDField. The value of this field was just 1, which was not a valid UUID hex string.

Removing this record fixed my issue.

Post a Comment for "Django Uuidfield Modelfield Causes Error In Django Admin: Badly Formed Hexadecimal Uuid String"