Issue
I have a Django web site running a mini CMS we've built internally years ago, it's using postgresql. When saving a simple title and a paragraph of text I get the following error:
value too long for type character varying(100)
The weird thing is, not a single column is varying(100) they are all 200 or 250, even the default Django ones have been changed from the 100 to 200 due to a re-opened ticket mentioned here
Does anyone know of a solution to this problem?
Solution
I can bet money you have a models.SlugField
without length set. The default length is 50 characters, most likely it's not enough for your use case.
Change it to models.SlugField(max_length=255)
and migrate your database schema.
Answered By - Michael Samoylov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.