Multi-Threaded Django Dev Server
Posted on 17. Dec, 2010 by Ash Christopher in Software Development
When using django, most of us use the ‘runserver’ that comes with Django. For the most part, it’s great and allows us to get things done quickly.
Where it starts to run into problems is when working on web-apps that make a lot of ajax calls or load media.
Ajax calls are especially important as the built-in ‘runserver’, which runs in a single thread, guarentees that the order the ajax calls is made is the order they get returned. In the real world, we know this doesn’t happen, and any good developer should plan for this.
Introducing django-concurrent-server (a fork of an existing project which I have updated). Now even better than the original – you can use PIP to install it!
This multi-threaded development server not only increases the performance of your development box, but will also allow you to test in less pristine conditions.
It works essentially exactly the same as Django’s own ‘runserver’ command – taking the same arguments and everything.
(secretproj)ash@dev:~/sandbox/secret-project/source$ python manage.py runcserver 0.0.0.0:8000 Validating models... 0 errors found Django version 1.2.3, using settings 'source.settings' Concurrent Development server is running at http://0.0.0.0:8000/ Quit the server with CONTROL-C.

