Tuesday, January 4, 2011

ContentType does not exist when trying to load auth with loaddata

Hi,

We are trying to migrate databases and we are running into problems.

We can dump the data:

./manage.py dumpdata --format=xml --natural --all --traceback auth > auth.xml

But when we try and load it, we get an exception:

./manage.py loaddata --database=mysql auth.xmlInstalling xml fixture 'auth' from absolute path.
Problem installing fixture 'auth.xml': Traceback (most recent call last):
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/core/management/commands/loaddata.py", line 167, in handle
for obj in objects:
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/core/serializers/xml_serializer.py", line 158, in next
return self._handle_object(node)
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/core/serializers/xml_serializer.py", line 198, in _handle_object
data[field.attname] = self._handle_fk_field_node(field_node, field)
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/core/serializers/xml_serializer.py", line 222, in _handle_fk_field_node
obj = field.rel.to._default_manager.db_manager(self.db).get_by_natural_key(*field_value)
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 15, in get_by_natural_key
ct = self.get(app_label=app_label, model=model)
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
File "/mnt/home/django/projects/rf/lib/python2.6/site-packages/django/db/models/query.py", line 341, in get
% self.model._meta.object_name)
DoesNotExist: ContentType matching query does not exist.


How do we get around this error? Shouldn't syncdb create the ContentTypes?


--
Eric Chamberlain

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate