I would like to import data into a Django project regularly. I need to tell the provider of my data what formats I want to received the data in. Should I ask for it in Json, XML, CSV ?
How does one usually deal with this in Django?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Django has a whole framework for importing data called Fixtures. You can read about the available formats (JSON is definitely there) here: https://docs.djangoproject.com/en/dev/howto/initial-data/
There are also examples of what the data should look like. Such as:
If you saved that as
beatles.json, you could import it by runningpython manage.py loaddata /path/to/beatles.json