from django.shortcuts import render
import requests
import json
# Create your views here.


def home(request):
    response = requests.get('https://api.covid19api.com/summary')
    data = response.json()
    globalRecord = data['Global']
    print(globalRecord)
    return render(request,'corona/home.html',{"globalRecord":globalRecord})



def news(request):
    response = requests.get('https://newsapi.org/v2/top-headlines',{"apikey":"6d75627c61754ef8926c25aae505f197","country":"in",'category':"health"})
    data = response.json()
    articles = data['articles']
    print(articles)
    return render(request,'corona/news.html',{'headline':articles})

def countrywise(request):
    
    return render(request,'corona/country.html')

d0c8628d2336e8a4f183687b94487717d860d351
<mask token>


def countrywise(request):
    return render(request, 'corona/country.html')

<mask token>


def home(request):
    response = requests.get('https://api.covid19api.com/summary')
    data = response.json()
    globalRecord = data['Global']
    print(globalRecord)
    return render(request, 'corona/home.html', {'globalRecord': globalRecord})


<mask token>


def countrywise(request):
    return render(request, 'corona/country.html')

<mask token>


def home(request):
    response = requests.get('https://api.covid19api.com/summary')
    data = response.json()
    globalRecord = data['Global']
    print(globalRecord)
    return render(request, 'corona/home.html', {'globalRecord': globalRecord})


def news(request):
    response = requests.get('https://newsapi.org/v2/top-headlines', {
        'apikey': '6d75627c61754ef8926c25aae505f197', 'country': 'in',
        'category': 'health'})
    data = response.json()
    articles = data['articles']
    print(articles)
    return render(request, 'corona/news.html', {'headline': articles})


def countrywise(request):
    return render(request, 'corona/country.html')

from django.shortcuts import render
import requests
import json


def home(request):
    response = requests.get('https://api.covid19api.com/summary')
    data = response.json()
    globalRecord = data['Global']
    print(globalRecord)
    return render(request, 'corona/home.html', {'globalRecord': globalRecord})


def news(request):
    response = requests.get('https://newsapi.org/v2/top-headlines', {
        'apikey': '6d75627c61754ef8926c25aae505f197', 'country': 'in',
        'category': 'health'})
    data = response.json()
    articles = data['articles']
    print(articles)
    return render(request, 'corona/news.html', {'headline': articles})


def countrywise(request):
    return render(request, 'corona/country.html')

from django.shortcuts import render
import requests
import json
# Create your views here.


def home(request):
    response = requests.get('https://api.covid19api.com/summary')
    data = response.json()
    globalRecord = data['Global']
    print(globalRecord)
    return render(request,'corona/home.html',{"globalRecord":globalRecord})



def news(request):
    response = requests.get('https://newsapi.org/v2/top-headlines',{"apikey":"6d75627c61754ef8926c25aae505f197","country":"in",'category':"health"})
    data = response.json()
    articles = data['articles']
    print(articles)
    return render(request,'corona/news.html',{'headline':articles})

def countrywise(request):
    
    return render(request,'corona/country.html')
