Daniele, I have fixed the indentation error.

@Lars, ProcessPoolExecutor uses multiprocessing which does not play well with Django. Actually > 1 concurrent jobs seems to be working for our experiments. In a production setting we will need a production-level priority queue, that's for granted. Here I am trying to simplify the development setting so that it is easier to develop without having to restart servers.