Member-only story
Import/Export Files in Django via the Admin Panel
My article is for everyone! Non-members can click on this link and jump straight into the full text!!
Recently, I came across a third-party library for Django django-import-export
that allows one to import and export data using the admin panel for files of different formats (csv
, json
, xls
, xml
, yaml
, tsv
). Today we are going to explore this library and see how it works.
Introduction
django-import-export
is a Django application and library for importing and exporting data with the included admin integration.
Requirements
django
django-import-export
1. Project Setup
Click here and follow the steps to create and activate a virtual environment.
Then install all the packages mentioned in the requirements.txt file.
2. Create the Project
django-admin startproject importexportadmin .
Note: The “.” at the end instructs manage.py
that you want the project to be constructed in the current folder and not in a sub-folder.
3. Create the App
python manage.py startapp app