[Answer]-Django. How to send 'fake' MIME type Image to avoid warning

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

Leave a comment