My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 26: loaddata error
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----

Sign in to add a comment
Reported by, Sep 22, 2011
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
  File "C:\Python25\Lib\site-packages\django\core\serializers\", line 165
, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "C:\Python25\Lib\site-packages\django\db\models\", line 549, in sa
    result = manager._insert(values, return_id=update_pk, using=using)
  File "C:\Python25\Lib\site-packages\django\db\models\", line 195, in
    return insert_query(self.model, values, **kwargs)
  File "C:\Python25\Lib\site-packages\django\db\models\", line 1518, in
    return query.get_compiler(using=using).execute_sql(return_id)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\", line 78
8, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\", line 73
2, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\", line 15, in e
    return self.cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\bas", line 44, in execute
    return self.cursor.execute(query, args)
IntegrityError: duplicate key value violates unique constraint "django_content_t
DETAIL:  Key (app_label, model)=(django_cron, cron) already exists.

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

Oct 3, 2011
thanks, i will try it
Sign in to add a comment

Powered by Google Project Hosting