1👍
✅
Well of course you’re going to get that message, you’re telling JavaScript to get an Image at some URL but instead text is being returned. You could just do
HttpResponse("ok", content_type="image/jpeg")
Though i’m not sure what the implications are of returning the string “ok” to a var image
in JavaScript.
see the documentation on the HttpResponse
Source:stackexchange.com