etiquette/etiquette_site_launch.py

30 lines
667 B
Python
Raw Normal View History

2016-11-27 09:06:11 +00:00
import gevent.monkey
gevent.monkey.patch_all()
2016-09-18 08:33:46 +00:00
2017-02-05 03:55:13 +00:00
import etiquette_site
2016-09-18 08:33:46 +00:00
import gevent.pywsgi
import gevent.wsgi
import sys
if len(sys.argv) == 2:
port = int(sys.argv[1])
else:
port = 5000
if port == 443:
http = gevent.pywsgi.WSGIServer(
2017-01-30 01:47:59 +00:00
listener=('0.0.0.0', port),
2017-02-05 03:55:13 +00:00
application=etiquette_site.site,
2016-11-27 09:06:11 +00:00
keyfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.key',
certfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.crt',
2016-09-18 08:33:46 +00:00
)
else:
2016-11-27 09:06:11 +00:00
http = gevent.pywsgi.WSGIServer(
2017-01-30 01:47:59 +00:00
listener=('0.0.0.0', port),
2017-02-05 03:55:13 +00:00
application=etiquette_site.site,
2016-11-27 09:06:11 +00:00
)
2016-09-18 08:33:46 +00:00
print('Starting server on port %d' % port)
2016-12-16 11:27:39 +00:00
http.serve_forever()