Hi,

I created a form, on submit i am triggering a script

When i use :
      #return HttpResponse(onsubmit, content_type="text/plain")

my results are good but i want to render it to template to get good output. 

*Output:*

*URL: https://abc.com/*
*Timestamp: Wed, Oct 31, 2018 18:44 GMT*
*HTTP Response Code: 500*


Trying with this (to render output to template):
  try:
      onsubmit = subprocess.check_output(["./test.py", abc])
      context = {
        'onsubmit': onsubmit,
}
      return render_to_response('output.html', context=context, 
content_type="text/html")

*Getting response :*

*b'URL: https://abc.com/\nTimestamp: Wed, Oct 31, 2018 18:44 GMT\nHTTP 
Response Code: 500\n*

Any idea how do i get output with newline ? 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 [email protected].
To post to this group, send email to [email protected].
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/4811eb48-8645-4238-9379-191cea04c749%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to