Perhaps there is a different way of going about this problem, but I am fairly new to using Django.
I have written a custom python script and would like to run a function
In django 1.11 and python 3.6, I had to use
return subprocess.run(['python', 'path_to_script//prog17.py', post_from_form], shell=False, timeout=1800)
The rest of @kossta's code worked fine.