Skip to content

Instantly share code, notes, and snippets.

View int-ua's full-sized avatar
🇺🇦
russia must be destroyed

Serhiy int-ua

🇺🇦
russia must be destroyed
View GitHub Profile
@int-ua
int-ua / import_file.py
Created December 28, 2017 19:38
Import management command for django-import-export
# https://gist.github.com/bmihelac/434fceb6ba8e752f08d3
# https://github.com/django-import-export/django-import-export/issues/332
from __future__ import unicode_literals
import mimetypes
from django.core.management.base import BaseCommand, CommandError
from django.utils import termcolors
from django.utils.encoding import force_text