1

is there any way to import csv file to django rest framework models? Thank You in advance.

2
  • I don't know why you got negative vote. But there is no REST Framework option available, you can do this using custom / raw solution. Commented Feb 2, 2018 at 9:06
  • The app django-import-export does this easily for you in django admin and can probably be tied in to a serializers quite easy. Commented Feb 5, 2018 at 8:45

1 Answer 1

1

Using python csv you can open/read/write/modify any csv file. Using this method, you can parse your file and save it using DRF.

I wont post any code because its a general understanding question. Good Luck.

https://docs.python.org/2/library/csv.html

Reading a CSV file using Python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.