2016-07-14 01:52:06 +02:00
|
|
|
#!/usr/bin/env python
|
2015-08-02 20:59:11 +02:00
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
base_path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
# Insert local directories into path
|
2016-10-04 18:48:26 +02:00
|
|
|
sys.path.insert(0,os.path.join(base_path, 'vendor'))
|
2015-08-02 20:59:11 +02:00
|
|
|
|
|
|
|
from cps import web
|
|
|
|
from cps import config
|
|
|
|
from tornado.wsgi import WSGIContainer
|
|
|
|
from tornado.httpserver import HTTPServer
|
|
|
|
from tornado.ioloop import IOLoop
|
|
|
|
|
|
|
|
global title_sort
|
|
|
|
|
|
|
|
def title_sort(title):
|
|
|
|
return title
|
|
|
|
if config.DEVELOPMENT:
|
|
|
|
web.app.run(host="0.0.0.0",port=config.PORT, debug=True)
|
|
|
|
else:
|
|
|
|
http_server = HTTPServer(WSGIContainer(web.app))
|
|
|
|
http_server.listen(config.PORT)
|
2016-07-16 11:17:43 +02:00
|
|
|
IOLoop.instance().start()
|