Skip to content

Instantly share code, notes, and snippets.

View callumgare's full-sized avatar
🦄

Callum Gare callumgare

🦄
View GitHub Profile
@callumgare
callumgare / import_file.py
Last active April 18, 2024 10:43 — forked from int-ua/import_file.py
Import management command for django-import-export
# From https://gist.github.com/int-ua/b2bcc4bea8227ab14a437900ff424723
# With a few fixes to get it working for Django 3.2
# (may or may not work for new versions too)
#
# Example usage: python manage.py import_file fixtures/categories.csv \
# --resource_class SearchApp.admin.CategoryResource \
# --model_name SearchApp.models.Category
from __future__ import unicode_literals
import mimetypes