Как выбрать начальную дату в фильтре конечной даты с помощью django и стороннего api

Я использую другой API в моем новом проекте Django для построения графика данных от начальной до конечной даты, но я понятия не имею, как я могу определить функцию Django без модели для остального API; здесь я прилагаю мой файл Django view.py и HTML файл файл view.py

def index(request):
site_url = 'http://172.24.105.27:8092/'

headers = {'Accept': 'application/vnd.github.v3+json','Authorization':'Basic Q'}

response = requests.get(site_url, headers=headers)
print(response)
response_json = response.json()
repositories = response_json['R']['L']
first_repo = repositories[0]
repo_names, repo_stars = [], []
for repo_info in repositories:
    repo_names.append(repo_info['M'])
    repo_stars.append(repo_info['A'])

data_plots = [{'type' : 'bar', 'x':repo_names , 'y': repo_stars}]
layout = {'title': 'MD Data','xaxis': {'title': 'Date and time'},'yaxis': {'title': 'Total       Import'}}
fig = {'data': data_plots, 'layout': layout}
plot_div = offline.plot(fig, output_type='div')
return plot_div

def index_view(request):
my_graph = index(request)
context={'graph':my_graph}
if request.method == "POST":
    queryset = index.object.all()
    fromdate = request.query_params.get('start_date', None)
    todate =   request.query_params.get('end_date', None)
    if fromdate and todate:
        queryset = queryset.filter(timstamp__range=[fromdate, todate])
    return render(request,"index.html",queryset)
return render(request, "index.html", context)

html файл

  From:<input type = "date" name = "fromdate"/>
   To:<input type = "date" name = "todate"/>
  <input type = "submit" value = "Search"/>
  {% if graph %}
  {{ graph|safe }}
 {% else %}
 <p>No graph was provided.</p>
 {% endif %}

Кто-нибудь может помочь, как я могу добавить дату начала и дату окончания?

Вернуться на верх