[Fixed]-Django calling a python script shows the html code instead of a webpage

1👍

return HttpResponse(output, content_type="text/plain")

The reason it’s returning escaped HTML is because you have content_type='text/plain', which says you are just sending plain text.

Try changing it to 'text/html'.

👤NS0

Leave a comment