[Django]-Django addConstraints raises a TypeError on Postgres

2👍

As it turns out, I had simplified my question by changing the constraint name, that was named name='%(app_label)s_%(class)s_value_matches_type in my code, for the sake of clarity.

But it seems that this name is the cause of the TypeError. Replacing the name fixes it.

2👍

You are using Django version 2, but interpolation of %(app_label)s and %(class)s was added in version 3.

👤mrts

Leave a comment