Questions tagged [dumpdata]

`django-admin.py dumpdata` is a command you could use to output to standard output all data in the database associated with the named application(s) in a Django powered website.

To see detailed information about django-admin.py dumpdata see the Django docs.

52 questions
1
vote
0 answers

Django model with JSONField: Why do I get a CommandError when trying to dump data in XML?

I have a Django model with a JSONField to handle multilingual text as follows: from django.contrib.postgres.fields import JSONField def default_language_JSON(): content = {} for lang in settings.LANGUAGES: …
TheVRChris
  • 171
  • 7
1
vote
1 answer

Django Dumpdata file contains debug logs

I'm dumping some data from my django app with the command python manage.py dumpdata > db.json Unfortunately the db.json contains some startup logs in the first lines of the files. The file looks like: DEBUG $HOME=/home/web DEBUG matplotlib data path…
Jibsgrl
  • 95
  • 1
  • 9
1
vote
1 answer

simplejson error with Django 1.8.2 and dumpdata

Command: % ./manage.py dumpdata Output: CommandError: Unable to serialize database: cannot import name simplejson zc.buildout is configured to install simplejson in the app directory. simplejson is also present in my custom Python directory,…
mpso
  • 1,129
  • 2
  • 13
  • 26
1
vote
2 answers

Django dumpdata output is empty

we have a Django 1.4.5 project with a PostgreSQL 9.3 backend. Unfortunately we are facing the problems when attempting to create fixtures for one of the apps (which is called sddb). The database is full of objects that belong to sddb…
Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64
1
vote
1 answer

Django Dumpdata - format date and time output

Im using a puython script to dumpdata to a json file, and then from there convert it to csv. call_command('dumpdata','document_manager.%s' % model_name,format='json',indent=2,stdout=output) This is the date and time from the generated JSON file: …
Harry
  • 13,091
  • 29
  • 107
  • 167
1
vote
1 answer

How to make a fixture of entire django project for limited data in database?

I have a Django--1.3 project that contains 40+ applications in it I have found this to make limited data fixture: manage.py makefixture --format=json --indent=4 proj.appname.modelname[1:1000] > test.json But this makes a fixture for only 1 app at a…
MHS
  • 2,260
  • 11
  • 31
  • 45
1
vote
0 answers

Dumpdata/Loaddata in Django 1.5

I am looking for help, Using Django1.5/Python2.7.3. I have two applications A and B. A equals B, the only difference is the ID, but the titles and slug are equal. I wonder if can with "loaddata" import A> B and B> A, Example: python manage.py…
Soy Latam
  • 182
  • 1
  • 2
  • 10
1
vote
1 answer

Django dumpdata doesn't write to file, generate "Bad file descriptor" error

I'm trying to dumpdata into a file, and keep getting this error: d:\django\mysite>manage.py dumpdata > alldata.json Traceback (most recent call last): File "D:\django\mysite\manage.py", line 10, in execute_from_command_line(sys.argv) …
Moti Radomski
  • 275
  • 2
  • 8
0
votes
1 answer

Error when using manage.py loaddata to load Django JSON file created with dumpdata

I am using ./manage.py loaddata file.json to load a JSON file created with ./manage.py dumpdata > ../directory/file.json, and I get the following error: matching_chars: 6 Traceback (most…
Andy Swift
  • 2,179
  • 3
  • 32
  • 53
0
votes
1 answer

Django's dumpdata only dumping auth permission and contenttypes data

I use local Postgres on the dev environment and deployed my app to Heroku with Postgres as well. I migrated my database, and now I want to load my data. The app works fine on Heroku, but without data. I have different settings files for dev and prod…
Rikki Tikki Tavi
  • 3,089
  • 5
  • 43
  • 81
0
votes
1 answer

Django - how to export and import user data for database migration?

I am moving my website to another cloud server for delpoying, so I have to export all the user information (account name, password, accounts.profile from the existing database, then import to the new website hosted by the new server. I have tried to…
Jack
  • 1,339
  • 1
  • 12
  • 31
0
votes
0 answers

Django manage.py dumpdata returns an error

Hello there! I have a Windows Home 10 (rus), Python 3.7, Django 3.1, Postgresql 12. When executing the command manage.py dumpdata returns an error. python manage.py dumpdata --traceback > db.json Traceback (most recent call last): File…
Leo
  • 31
  • 4
0
votes
1 answer

Django dumpdata CommandError: Unable to serialize database: invalid literal for int() with base 10

When I run the following command to export my database in a JSON file : python manage.py dumpdata > datadump.json I have the following error message : CommandError: Unable to serialize database: invalid literal for int() with base 10: b'19…
jarbinks
  • 23
  • 7
0
votes
1 answer

create fixtures with custom manager methods, json dumps and ways to avoid type error :xxx is not json serializable

I'm trying to create a test fixture using custom manager methods as my app uses a subset of dbtables and fewer records. so i dropped the idea of using initial_data. In manager I'm doing something like this. in Managers.py: sitedict =…
stackover
  • 6,275
  • 6
  • 22
  • 20
0
votes
1 answer

How to properly extend django user model and seed databse

I created a model that extends on Django's user model. I am now trying to seed the database with this type of user, but I get an error when trying to use the loaddata call. I extended the user model, creating a different user type called…