Created
November 13, 2014 19:32
-
-
Save pedroburon/fc2c82318f25f971e4f9 to your computer and use it in GitHub Desktop.
greenrunserver.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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