Sterilistic / django-cron

Automatically exported from code.google.com/p/django-cron
MIT License
0 stars 0 forks source link

loaddata error #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 commented 8 years ago
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 commented 8 years ago
thanks, i will try it

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