Wednesday, August 22, 2012

Re: django.db.utils.DatabaseError when resyncing django app models

On 22/08/2012, at 1:51 PM, Karen Tracey wrote:

The key part of the traceback is this:

  File "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 54, in create_permissions
    auth_app.Permission.objects.bulk_create(objs)

which indicates the problem is related to the creation of permissions for your models (I can't explain why you are seeing this on a 2nd syncdb unless you are actually adding models, though I don't see any tables created in your output so that is a bit confusing). You are hitting this ticket:

https://code.djangoproject.com/ticket/17763

Solution at this point in time is either to shorten names in your models or manually increase the length of the too-small field(s) in the auth_permission table.

Karen



Hi Karen,

Thanks a lot for your help. I am not adding any classes to the app on the second sync, correct me if I am wrong but django only resyncs new classes? I find it very odd that the error occurs only with the second resync... I will try your suggestions and let you know how I go, Thanks a lot!

Cheers


0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate