Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Django management command to export choosen data from one table

Project description

Django Dumpdata One

Custom dumpdata command which allows to exporting from given fields of a model and filter that data using standard Django lookups for filtering.

The exported data structure is compatible with Django dumpdata structure which allows you to use standard loaddata command for import.


To get the latest stable release from PyPi

pip install django-dumpdata-one

Add dumpdata_one to your INSTALLED_APPS



Export data:

./ dumpdata_one app_name.model_name --fields=field1,field2 > dump_file.json

Import data:

./ loaddata dump_file.json

How to use filters? If you not familiar take a look at Django Field lookups -

./ dumpdata_one app_name.model_name --fields=field1 --filter=name__icontains=django

./ dumpdata_one app_name.model_name --fields=field1 --filter=name__icontains=django,pk__gt=300

Set order by:

./ dumpdata_one app_name.model_name --fields=field1,field2 --order=field2,field2

Export all fields:

./ dumpdate_one app_name.model_name --fields=*

Limit number of exported records:

./ dumpdata_one app_name.model_name --fields=* --limit=10

Export full file URL:

./ dumpdata_one app_name.model_name --fields=image --full_url=image

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-dumpdata-one, version 0.8.3
Filename, size File type Python version Upload date Hashes
Filename, size django_dumpdata_one-0.8.3-py3-none-any.whl (5.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-dumpdata-one-0.8.3.tar.gz (7.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page