To execute Linux commands in Python we have great modules: os and subprocess. I have integrated Linux commands in the console based python program using both os and subprocess module however the same thing doesn't happen in Django. Take an example of this view:
def hello(request):
res = os.system('ls')
return render_to_response('thanks.html', {'res':res}, context_instance=RequestContext(request))
The only thing this view returns is 0. I have tried with subprocess too. The output I get is 0. What's wrong?