Skip to main content

Import/Export feature for django models

Project description


Imports and Exports django model to excel and csv


python >= 3
Django 1.11.5, >= 2.11


pip install model-import-export


Creating resources

In your example_app/

from model_import_export.resources import ModelResource, ForeignKeyResource, ManyToManyResource

from dashboard.models import *

class UserResource(ModelResource):

	class Meta:
		model = User
		fields = '__all__'

Exporting model

from .resources import UserResource

queryset = User.objects.all()
resource = UserResource(queryset)

Importing model

resource = UserResource()

Model Import/Export Example

GitHub model_import_export_example

Project details

Download files

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

Source Distribution

model_import_export-0.1.4.tar.gz (5.6 kB view hashes)

Uploaded source

Built Distributions

model_import_export-0.1.4-py3.7.egg (10.9 kB view hashes)

Uploaded 0 1 4

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page