Skip to content
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 error #26

Open
GoogleCodeExporter opened this issue Dec 16, 2015 · 2 comments
Open

loaddata error #26

GoogleCodeExporter opened this issue Dec 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

when i use sqlite the cron work very well.then i dumpdata and be ready to use 
postgresql, when i loaddata it give a error,see blow. It's the cron error?

Installing json fixture 'data' from absolute path.
Problem installing fixture 'data.json': Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\django\core\management\commands\loaddata.p
y", line 174, in handle
    obj.save(using=using)
  File "C:\Python25\Lib\site-packages\django\core\serializers\base.py", line 165
, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "C:\Python25\Lib\site-packages\django\db\models\base.py", line 549, in sa
ve_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "C:\Python25\Lib\site-packages\django\db\models\manager.py", line 195, in
 _insert
    return insert_query(self.model, values, **kwargs)
  File "C:\Python25\Lib\site-packages\django\db\models\query.py", line 1518, in
insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\compiler.py", line 78
8, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\compiler.py", line 73
2, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\util.py", line 15, in e
xecute
    return self.cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\bas
e.py", line 44, in execute
    return self.cursor.execute(query, args)
IntegrityError: duplicate key value violates unique constraint "django_content_t
ype_app_label_model_key"
DETAIL:  Key (app_label, model)=(django_cron, cron) already exists.


Original issue reported on code.google.com by myuses...@gmail.com on 22 Sep 2011 at 1:18

@GoogleCodeExporter
Copy link
Author

This is because exists the app  in the data base. Try with one dumpdata per 
each app.
example: manage.py dumpdata name_app --exclude drjango_cron
So it goes to copy all except django_cron.

Original comment by juan.car...@gmail.com on 29 Sep 2011 at 1:13

@GoogleCodeExporter
Copy link
Author

thanks, i will try it

Original comment by myuses...@gmail.com on 3 Oct 2011 at 3:28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant