I'm really new in django. I need to run a bash script when I push a button in html, and I need to do it with Django Framework, because I used it to build my web. I'd be grateful if anybody could help me
Edit: I have added my template and my views for being more helpful. In the 'nuevaCancion' template, I use 2 views.
<body>
{% block cabecera %}
<br><br><br>
<center>
<h2> <kbd>Nueva Cancion</kbd> </h2>
</center>
{% endblock %}
{% block contenido %}
<br><br>
<div class="container">
<form id='formulario' method='post' {% if formulario.is_multipart %} enctype="multipart/form-data" {% endif %} action=''>
{% csrf_token %}
<center>
<table>{{formulario}}</table>
<br><br>
<p><input type='submit' class="btn btn-success btn-lg" value='Añadir'/>
<a href="/ListadoCanciones/" type="input" class="btn btn-danger btn-lg">Cancelar</a></p>
</center>
</form>
<br>
</div>
<center>
<form action="" method="POST">
{% csrf_token %}
<button type="submit" class="btn btn-warning btn-lg">Call</button>
</form>
</center>
{% endblock %}
</body>
Views.py
def index(request):
if request.POST:
subprocess.call('/home/josema/parser.sh')
return render(request,'nuevaCancion.html',{})
parser.sh
#! /bin/sh
python text4midiALLMilisecs.py tiger.mid