My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  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 myuses...@gmail.com, 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
    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.


Sep 29, 2011
#1 juan.car...@gmail.com
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.

Oct 3, 2011
#2 myuses...@gmail.com
thanks, i will try it
Sign in to add a comment

Powered by Google Project Hosting