I have been writing some a django project / app that initiates some test scripts. I previously asked a question about how to do this here.. integrating python scripts with django
I've hit a problem which I didn't think would happen. I have a form working, using jquery to display certain checkboxes that pass values which initiates an api to my application I am testing. Exactly like the code in my initial question. However, when I submit the form, the form hangs whilst the back end process finishes
submittest.initialise_test(t_start, t_templatename, t_datacenter)
return render_to_response('testsubmitted.html')
I know I could use a popen or cron, however I have written my app and it would take some re-engineering.
Any ideas how I could make the submittest.initialise_test(t_start, t_templatename, t_datacenter) an asynchronous call or a way to get round this issue?. The results get written to a database, which I was then hoping to use to render to a results page using ajax to update the results.