github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jaylett / django_concurrent_test_server

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 6
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Quick hack that provides a runconcurrentserver command, broadly similar to Django ticket:3357 without patching Django itself — Read more

  cancel

http://code.djangoproject.com/ticket/3357#comment:24

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

RUNSERVER_DEFAULT_ADDR / RUNSERVER_DEFAULT_PORT in settings.py override 
the defaults. 
jaylett (author)
Sat Feb 06 05:03:12 -0800 2010
commit  7758f6b0f83daec6587c6ccf884e398139d54e81
tree    6c6b10f9262861816272891ed47529f5dd93b669
parent  cd3914a23f02743f557059eb31e61c2a1f29f49b
django_concurrent_test_server /
name age
history
message
file LICENSE Loading commit data...
file README Sat Feb 06 05:03:12 -0800 2010 RUNSERVER_DEFAULT_ADDR / RUNSERVER_DEFAULT_PORT... [jaylett]
file __init__.py Thu Jun 25 12:34:16 -0700 2009 First commit: rough testing, no documentation [jaylett]
directory management/
file servers.py
README
=============================
django_concurrent_test_server
=============================

<http://code.djangoproject.com/ticket/3357> is a Django ticket about making the built-in dev server concurrent. This 
isn't going to happen any time soon, but one of the comments wondered about turning the patch in the ticket into a 
separate app that could be dropped in to provide a concurrent dev server as a new command. This is what 
django_concurrent_test_server does.

Note that with the forking server, it is possible for a child process to survive when the parent dies; the child retains 
the open listen socket, so you have to find it and kill it before restarting the server. It should be possible to fix 
this, but I haven't looked into it yet; unless you are aware of threading problems in your code or extensions, you 
should probably use that for preference.

Almost all the work was done by Istvan Albert, as per <http://is.gd/1h6JX> on 
<http://groups.google.com/group/django-developers/>. Additionally I've duplicated the runserver command from Django 
itself, and repackaged the whole lot.

Given the context of the original discussion, and the presence of the patch on the Django ticket, I'm distributing this 
under the Django license with the normal "Django Software Foundation and individual contributors" copyright statement.

James Aylett <http://tartarus.org/james/computers/django/>

Usage
=====

1. Drop the django_concurrent_test_server directory somewhere on your PYTHONPATH
2. Add django_concurrent_test_server to your INSTALLED_APPS
3. If threads worry you, and bearing the above warning in mind, set
   CONCURRENT_THREADING = False in settings.py to use forking
4. Use ./manage.py runconcurrentserver to start a concurrent server
5. (optional) Add CONCURRENT_RANDOM_DELAY = True to your settings.py to
   introduce a small, random delay into each request; useful for finding race
   conditions. (By <http://github.com/wolever>.)
6. (option) Set RUNSERVER_DEFAULT_ADDR / RUNSERVER_DEFAULT_PORT in settings.py
   to override the defaults without having to hack the code. Useful for people
   who don't like aliases, or move things between machines a lot.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server