Browse Source

Updated example app to use gevent websocket if available

pull/5/head
Miguel Grinberg 10 years ago
parent
commit
7b2e4ab887
  1. 11
      example/app.py
  2. 2
      example/requirements.txt

11
example/app.py

@ -105,6 +105,15 @@ if __name__ == '__main__':
elif async_mode == 'gevent':
# deploy with gevent
from gevent import pywsgi
pywsgi.WSGIServer(('', 5000), app).serve_forever()
try:
from geventwebsocket.handler import WebSocketHandler
websocket = True
except ImportError:
websocket = False
if websocket:
pywsgi.WSGIServer(('', 5000), app,
handler_class=WebSocketHandler).serve_forever()
else:
pywsgi.WSGIServer(('', 5000), app).serve_forever()
else:
print('Unknown async_mode: ' + async_mode)

2
example/requirements.txt

@ -1,4 +1,2 @@
eventlet==0.17.4
greenlet==0.4.7
python-engineio==0.1.0
six==1.9.0

Loading…
Cancel
Save