Created
July 16, 2018 23:41
-
-
Save hex128/ed38e1cde4bc004821546cff7a5bb8a6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import eventlet | |
eventlet.monkey_patch() | |
from eventlet import wsgi | |
from app.wsgi import application | |
from optparse import OptionParser | |
def run_wsgi_app(app, address='', port=8080, max_threads=25): | |
wsgi.server(eventlet.listen((address, port)), app, max_size=max_threads) | |
if __name__ == '__main__': | |
parser = OptionParser() | |
parser.add_option('-a', '--address', type=str, default='0.0.0.0') | |
parser.add_option('-p', '--port', type=int, default=8080) | |
parser.add_option('-t', '--threads', type=int, default=25) | |
(options, args) = parser.parse_args() | |
run_wsgi_app(application, options.address, options.port, options.threads) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment