I am trying to deploy my Django app that have the following view
class TransitionCreate(UpdateView):
model = Automata
fields = []
# some more code
def form_valid(self, form):
context = self.get_context_data()
transitions = context['transitions']
with transaction.atomic():
self.object = form.save()
if transitions.is_valid():
transitions.instance = self.object
transitions.save()
command = "python make_graph.py"
subprocess.call(command, shell=True)
return super(TransitionCreate, self).form_valid(form)
For some reason the make_graph script doesn't run when I call the view, however when I run it straight from the bash it works just fine