Created
June 20, 2010 12:20
-
-
Save laiso/445785 to your computer and use it in GitHub Desktop.
Run gevent wsgiserver for pylons app.
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
#!/usr/bin/env python | |
# coding: utf-8 | |
from gevent import monkey; monkey.patch_all() | |
from gevent.wsgi import WSGIServer | |
import os | |
import logging | |
log = logging.getLogger(__name__) | |
from paste.deploy import loadapp | |
PORT = 8088 | |
def main(): | |
config_path = os.path.join(os.path.abspath(os.path.curdir), 'development.ini') | |
wsgi_app = loadapp('config:' + config_path) | |
log.info('Serving on %d...' % PORT) | |
WSGIServer(('', PORT), wsgi_app).serve_forever() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment