django verbose_name limitation
This is one of those things you never know about until it happens to you.
Some days ago, while working on a django project, I made some changes to an app models. Since I was at the beginning stages of the development process, I just droped the database, created it again and I used syncdb to recreate the whole thing (yes, I used syncdb because I didn't use nor django-evolution neither south or any other migrations tool).
It seemed to be working properly:
snowball:Zero14 wu$ python manage.py syncdb Creating table auth_permission Creating table auth_group Creating table auth_user Creating table auth_message
But after created the default user to access the admin interface, I got this error:
psycopg2.ProgrammingError: value too long for type character varying(50)
(full trace here).
It seems like something (probably in models.py) was wrong. I revised my models file, nothing about a field limited to 50 characters... strange.
As usual, I asked in #django (on freenode) and, as usual, Magus- pointed me in the right direction, asking me if I had any model with a name longer than 50 characters. Of course I do not have any model with such a long name, but searching a little bit deeper, I found that one of the models had a verbose_name had a 80-character long string associated.
Replacing that with a more appropiate string (below 50 characters) fixed the problem.