Передача json из js в представления в django

Я пытаюсь передать некоторые данные из JavaScript в представления python

Вот мой JS код:

sourcejson = JSON.stringify(sourceGoal)
jsonmap = JSON.stringify(mapgraph.showNodes())
json = JSON.stringify(straightLineToDestination)

$.ajax({
  type: "get",
  url: "",
  dataType: 'json',
  data: jsonmap,
  success: function(response) {
    graphview.appendChild('<p>' + response.result + '</p>')
  }
});

$.ajax({
  type: "get",
  url: "",
  dataType: 'json',
  data: sourceGoal,
});

$.ajax({
  type: "get",
  url: "",
  dataType: 'json',
  data: straightLineToDestination,
});

вот мой views.py

import imp
import json
from telnetlib import STATUS
from urllib import request
from django.shortcuts import render
from django.http import HttpResponse
import os
from django.views.generic import View
from queue import PriorityQueue
from django.http import JsonResponse

class ajaxhandlerview(View):
     def get(self,request):
          return render(request,'index.html')

     def post(self,request):
               global GRAPH
               global straight_line
               global SourceandGoal
               GRAPH=json.loads(request.Get.get('jsonmap'))
               straight_line=json.loads(request.Get.get('straightLineToDestination'))
               SourceandGoal=json.loads(request.Get.get('sourceGoal'))
               print(GRAPH)
               print(straight_line)
               print(SourceandGoal)

               if request.is_ajax():

                heuristic, cost, optimal_path = a_star(SourceandGoal.start, SourceandGoal.end)
                result=' -> '.join(city for city in optimal_path)
                return JsonResponse({"heuristic":heuristic,"cost":cost,"optimal_path":optimal_path,"result":result},STATUS=200)
               return render(request,'index.html')

def a_star(source, destination):
          """Optimal path from source to destination using straight line distance heuristic
          :param source: Source city name
          :param destination: Destination city name
          :returns: Heuristic value, cost and path for optimal traversal
          """

          priority_queue, visited = PriorityQueue(), {}
          priority_queue.put((straight_line[source], 0, source, [source]))
          visited[source] = straight_line[source]
          while not priority_queue.empty():
               (heuristic, cost, vertex, path) = priority_queue.get()
               if vertex == destination:
                    return heuristic, cost, path
               for next_node in GRAPH[vertex].keys():
                    current_cost = cost + GRAPH[vertex][next_node]
                    heuristic = current_cost + straight_line[next_node]
                    if not next_node in visited or visited[next_node] >= heuristic:
                         visited[next_node] = heuristic
                         priority_queue.put((heuristic, current_cost, next_node, path + [next_node]))

urls.py:

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', ajaxhandlerview.as_view()),
]

Я могу видеть данные в терминале, но функция успеха не работает и не получает результат обратно на мою домашнюю страницу

> "GET
> /?{%22damascus%22:{%22allepo%22:%2239%22,%22homs%22:%2223%22},%22allepo%22:{%22damascus%22:%2214%22,%22homs%22:%2223%22},%22homs%22:{%22damascus%22:%2227%22,%22allepo%22:%2225%22}}
> HTTP/1.1" 200 1216

 
> "GET /?start=damascus&end=allepo HTTP/1.1" 200 1216

 
> "GET /?allepo=30&homs=25&damascus=22 HTTP/1.1" 200 1216
Вернуться на верх