Django SYNCDB or SQL error, in core models.

35 views
Skip to first unread message

upmauro

unread,
Jun 19, 2012, 2:17:27 PM6/19/12
to django...@googlegroups.com
Hi all !

When i begin my application i used inspectdb to generate models, after this when i try use SYNCDB or SQL <APPNAME>

Django raise this exception:

python2.7 manage.py syncdb

Error: One or more models did not validate:
core.djangocontenttype: "app_label": CharField cannot have a "max_length" greater than 255 when using "unique=True".
core.djangocontenttype: "model": CharField cannot have a "max_length" greater than 255 when using "unique=True".
core.authpermission: "codename": CharField cannot have a "max_length" greater than 255 when using "unique=True".
core.sessions: "session_id": CharField cannot have a "max_length" greater than 255 when using "unique=True".

Diego pascual lopez

unread,
Jun 20, 2012, 8:03:42 AM6/20/12
to django...@googlegroups.com


On Tue, Jun 19, 2012 at 8:17 PM, upmauro <upm...@gmail.com> wrote:
Hi all !

HI,
do you use max_length parameter?

could you show us your models.py files? 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/dTZtUfSDBpEJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Harjot Mann

unread,
Jun 20, 2012, 9:09:04 AM6/20/12
to django...@googlegroups.com
SQL does not allow max_length>255 while using unique=True........so either you have to minimize the max_length or to remove unique..For more information just go through the following links
https://groups.google.com/forum/?fromgroups#!topic/django-developers/7fMxLE-h0tQ
https://groups.google.com/forum/?fromgroups#!topic/django-users/rRaMzqhBLg8
Reply all
Reply to author
Forward
0 new messages