On Tue, Mar 20, 2018 at 10:23 AM, Mukesh Jha <talklikemuk...@gmail.com> wrote:
> I want to access a api from http://open-platform.theguardian.com/ or
> https://newsapi.org/ and load it into my sqlite database. The data in these
> site is in json format and I want them to get converted into my database
> model format and store in it and later on use them as when queried. I am
> clueless as I am quite new in this development system. Please help if
> possible.
>

Adjust for your needs:

  data = requests.get(url).json()
  for datum in data:
      MyModel.objects.save(**datum)

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1%2BHs0DHHZtpR8L2asSAtNLdw_NaJF-ST9%2BRsTwQ021-fA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to