Skip to content

Instantly share code, notes, and snippets.

@pedroburon
Created November 13, 2014 19:32
Show Gist options
  • Save pedroburon/fc2c82318f25f971e4f9 to your computer and use it in GitHub Desktop.
Save pedroburon/fc2c82318f25f971e4f9 to your computer and use it in GitHub Desktop.
greenrunserver.py
def run(addr, port, wsgi_handler, ipv6=False, threading=False):
server_address = (addr, port)
from gevent.wsgi import WSGIServer
WSGIServer(server_address, wsgi_handler).serve_forever()
def patch_runserver(run=run):
from django.core.servers import basehttp
basehttp.run = run
# put this above everything else
from greenrunserver import patch_runserver
patch_runserver()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment