New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loaddata of example got errors #7
Comments
Hi, I just commited the 0.2 version a couple of days ago, are you using this new version? Actually the example project was broken before in 0.1.x, that was one thing I fixed. I also updated the project layout to Django 1.4, so you need this new Django version to get the example up and running. |
Thanks for your rapid reply. On Mon, Jun 25, 2012 at 9:56 PM, Holger Drewes <
Best regards, Gorf Liu |
Hi, I think I found the problem, I was creating the example data with automatically generated objects by Django, which can be problematic (see: https://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys). I just created a new fixture and committed it to GitHub: https://github.com/holgerd77/django-dynamic-scraper/blob/master/example_project/open_news/open_news.json just containing the essential app data. If you use that file for loaddata, I assume it should work. Would be nice, if you give some short feedback! |
It's ok now. |
I config the example.
when I run python manage.py loaddata open_news/open_news.json
I got the errors below:
$ python manage.py loaddata open_news/open_news.json
Problem installing fixture 'open_news/open_news.json': Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/django/core/management/commands/loaddata.py", line 196, in handle
obj.save(using=using)
File "/usr/lib64/python2.7/site-packages/django/core/serializers/base.py", line 165, in save
models.Model.save_base(self.object, using=using, raw=True)
File "/usr/lib64/python2.7/site-packages/django/db/models/base.py", line 551, in save_base
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/usr/lib64/python2.7/site-packages/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/lib64/python2.7/site-packages/django/db/models/query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib64/python2.7/site-packages/django/db/models/sql/compiler.py", line 910, in execute_sql
cursor.execute(sql, params)
File "/usr/lib64/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/usr/lib64/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
IntegrityError: Could not load contenttypes.ContentType(pk=25): columns app_label, model are not unique
What's wrong with it ?
The text was updated successfully, but these errors were encountered: