1👍
Use JsonResponse instead of render or HttpResponse. https://docs.djangoproject.com/en/1.10/ref/request-response/
Import from django http:
from django.http import JsonResponse
And use like this:
return JsonResponse(context)
This way you don’t have any page reload, and you can use the response in your javascript.
👤Alex
Source:stackexchange.com