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:
*URL: https://abc.com*
*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 :
*b'URL: https://abc.com/\nTimestamp: Wed, Oct 31, 2018 18:44 GMT\nHTTP 
Response Code: 500\n*

Any idea how to print this output with newline (like above) ? Any help is 
appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a10aaa67-c129-478d-861c-a88a6b5a1cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to