I have two methods defined in views.py. the first one calls the second one:
@login_required
def form1(request):
if request.method == 'POST':
form = JobForm(request.POST)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
return HttpResponseRedirect(job)
else:
return render_to_response('sync_form.html', {'form': form})
def job(request): #I get the error right here
cmd = '/root/test.sh'
p = Popen(cmd, shell=True, stdout=PIPE)
in_progress = p.communicate()
return render_to_response('job.html', {'in_progress': in_progress})
I get 'Invalid Syntax' where I define the second method. Can someone help me out? Thanks in advance.