-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (21 loc) · 814 Bytes
/
main.py
File metadata and controls
29 lines (21 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Geoff Wilson <gmwils@gmail.com>
import os
import sys
import tornado.ioloop
from cihui import app
from cihui.data import account
from cihui.data import wordlist
db_url = os.environ.get('DATABASE_URL', 'postgresql://localhost:5432/cihui')
port = int(os.environ.get("PORT", 5000))
debugMode = False
if len(sys.argv) > 1 and sys.argv[1] == '--debug':
debugMode = True
application = app.CiHuiApplication(account.AccountData(db_url),
wordlist.WordListData(db_url),
os.environ.get('COOKIE_SECRET', None),
debug=debugMode
)
if __name__ == "__main__":
application.listen(port)
tornado.ioloop.IOLoop.instance().start()