1

I want to run the following command and its sending output to template

def nikto(request):
    context = {}
    host = request.GET.get('host', False)

    nikto_output = os.popen('nikto -h ' + request.GET['host']).read()
    # context['nikto_output'] = nikto_output
    context['nikto_output']=nikto_output
    return render(request,'nikto.html',context)
    # return render(request,'nikto.html',context)

but it's first performing a complete task and then sent to the template, till then webpage is loading, I want to display one-by-one line output. if you know of any solution, please let me know.

1 Answer 1

1
nikto_output = os.popen('nikto -h ' + request.GET['host']).readlines()

try this

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks but still same issue
then this answer should cover your question. stackoverflow.com/a/18422264/11027652

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.