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.3.tar.gz (5.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page