1 year ago
#386478
peter roy
Show file contents to html page in django
I am running one shell script from django views.py. Below is the code:
def result(request):
if request.method=="POST":
process=subprcoess.Popen(cmd, shell=True, stdout=subprcoess.PIPE, stderr=subprcoess.PIPE, universal_newlies=True)
while process.poll() is None:
print(process.communicate()[0])
continue
return render(request, 'result.html')
Now here can able to get logs on file, instead directly need to redirect to html page.
Could anyone please help here?
Thank You.
python
django
subprocess
0 Answers
Your Answer