value too long for type character varying


I got this error some time.
But is it possible to know witch models.CharField name is concerned ?
Or is it possible to cut the string automatically ?

For example :
models.CharField(max_length = 200)
and the string to string[:199]

Thanks for your help and sorry for my english (I am french)


Please post the complete traceback message you’re getting in the console. That’ll help identify the source of the problem. (Don’t post an image, copy/paste the text into the body of your message. Surround the text with lines of ``` to maintain proper formatting. That means you’ll have a line of ``` before the traceback, then the traceback, then another line of ```)

Also, if you at least know what view or function is causing the problem, post that, too - also between lines of ```.