My main project is to collect and show the results from news site of a particular topic. I have use the guardian's api and I have been given 4 keywords. If I click on any one of the keyword, I need to display all the recent articles related to it. Now what I have understood is:
import json,urllib.request
lurl=[] #list to store the url of articles
ldate=[] #list to store the date of publish of url
for i in range(0,10):
lurl.append(data['response']['results'][i]['webUrl'])
ldate.append(data['response']['results'][i]['webPublicationDate'])
for i in range(0,10):
print(ldate[i]+" : ",end="")
print(lurl[i])
Now I have to store all such values in my database and call it in views page.
class tesla(models.Model):
id1=models.CharField(max_length=10000)
webTitle=models.CharField(max_length=10000)
webUrl=models.CharField(max_length=10000)
apiUrl=models.CharField(max_length=10000)
webPublicationDat=models.CharField(max_length=10000)
How can I do it? Please help.