The workflow I'm dealing with (by user) is as follows:
- User submits information and files in the form
- The form is saved
- Additional processing is performed after saving.
This is normal, but processing after saving takes a lot of time, so I want to do this in the background and issue an HttpResponseRedirect to a message informing the user that the processing is happening, and return later. Unfortunately, this does not seem to work; what i have at the moment:
if form.is_valid(): p = multiprocessing.Process(target=form.save) p.start() return HttpResponseRedirect('/running')
But the error I am returning is this:
IOError at /content/script/new/ sys.stdout access restricted by mod_wsgi ... /usr/lib/python2.6/multiprocessing/forking.py in __init__
Does python have a more magical way to do this? Is it Django? If not, how can I continue and use multiprocessing?
source share