This time, as the title says, we will use restapi to return the data registered in models.py in json format and plot it on the map. I myself have never touched the map app at the beginner level of django, so I would be grateful if you could refer to it when someone with a similar level stumbles.
def index_serialized(request):
evacuation=Evacuation.objects.all()
serialized=EvacuationSerializer(evacuation,many=True)
content=JSONRenderer().render(serialized.data)
return HttpResponse
Recommended Posts