def home(request): pids = p.get_pids('java') if len(pids) > 0: status = 'online' else: status = 'offline' return render(request,'home.html',{'status':status} )
def reboot(request): pids = p.get_pids('java') if(len(pids) > 0): for pid in pids: p.kill(pid) p.start_server(settings.SERVER_SCRIPT_LOCATION) return HttpResponse('server restarting... this could take a few seconds')