Giter VIP home page Giter VIP logo

django-concurrent-server's Introduction

django-concurrent-server

This is a fork of James Aylett's django_concurrent_test_server. It has been updated to use setuptools for installation allowing developers to install with package management such as pip.

I have also updated the package structure and command names as James made them just too darn long.

Usage

  1. Install django-concurrent-server via whatever mechanism you see fit (I suggest pip).
    pip install -e git+git://github.com/ashchristopher/django-concurrent-server.git#egg=django-concurrent-server

  2. Add concurrent_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 runcserver 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.

See his documentation below for relevant information about his original package.

<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/>

django-concurrent-server's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.