Provide a way to start development server from within in non-blocking mode
|Reported by:||bugs@…||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Use-case: It web application development, it's common and good practice to do functional test using browser-driven testing tools like Selenium. Especially Selenium has nice concept of remote control, which can be used to integrate Selenium tests into standard unittest framework.
However, as this tool is starting browser and simulating "clicks" and doing some verifications, it requires server to run. Current testing Client bypass this need by using dispatcher, but this is insufficient.
Required change is to extend django.core.servers.basehttp.run() method to take non_blocking=False argument. When True provided, httpd should not be served_forever(), but started in non-blocking mode (being forked to another thread perhaps?). This will be called by django.test.utils.setup_test_environment(), so server will be available for all tests + it should be then easy for users to integrade selenium into test system.
As this problem cause me real pain, I'm willing to contribute on this patch, I'd just like to hear acceptance decision + preferred way to do this.