from dashboard.models import Spi, Finance from django.shortcuts import render def ghyc(request): month = request.GET.get('month', '1') months = range(1, 13) year = request.GET.get('year', '1979') years = range(1979, 2018) spis = Spi.objects.filter( month=month) return render(request,'predict/ghyc.html',{'month':month,'months':months,'spis':spis,'year':year,'years':years})