I have a method written in my views.py that sends a sub-process command.
I want to be able to click a button on my Django application and it initiates the method I wrote.
How can I do this?
This is currently my function in my views.py
def send_command(request):
output = subprocess.check_output('ls', shell=True)
print(output)
return render(request, 'button.html')
I also have a button in a .html file
<center><button type='submit' class='btn btn-lg'>Button</button></center>
I'm VERY new to this so but any help would be appreciated. Please feel free to ask for more info.