Hi,
I am executing script using django form and it provides me below results. It's good but i would like to render it to html template.
return HttpResponse(onsubmit, content_type="text/plain")
Output:
Timestamp: Wed, Oct 31, 2018 18:44 GMT
HTTP Response Code: 500
When i use below for render part my output is not showing with newline.
try:
onsubmit = subprocess.check_output(["./xyz.py", abc])
#return HttpResponse(onsubmit, content_type="text/plain")
context = {
'onsubmit': onsubmit,
}
return render_to_response('output.html', context=context, content_type="text/html")
Output :
Any idea how to print this output with newline (like above) ? Any help is appreciated.