In my django project in order to avoid another request I would like to return a JsonResponse with a HttpResponse in there like this:
JsonResponse({"known": True, "space": render(request, 'space.html')}, status=200)
Django process returns the normal internal error Object of type HttpResponse is not JSON serializable
I tried all the web solutions (serializer, etc.) and can not find a way to return a json format (necessary for my javascript) with dictionary entries with one of them being an entire html page that I can use with then with $("body").html(response["space"])
.
Am I missing something?
Thanks for your time.