Add .ini configuration management

This commit is contained in:
richard-dds 2018-06-11 13:17:40 -04:00
parent 2e6a6bb53d
commit 41701290ea
4 changed files with 16 additions and 7 deletions

2
.gitignore vendored
View File

@ -25,3 +25,5 @@ static/fonts/*
# local log files
log/*
config/dev.ini

18
app.py
View File

@ -1,11 +1,15 @@
#!/usr/bin/env python
from atst.app import make_app
import tornado.ioloop
import os
import tornado.ioloop
app = make_app(debug=os.getenv('DEBUG',False))
port = 8888
app.listen(port)
print("Listening on http://localhost:%i" % port)
tornado.ioloop.IOLoop.current().start()
from atst.app import make_app, make_config
config = make_config()
app = make_app(config)
if __name__ == '__main__':
port = int(config['default']['PORT'])
app.listen(port)
print("Listening on http://localhost:%i" % port)
tornado.ioloop.IOLoop.current().start()

3
config/base.ini Normal file
View File

@ -0,0 +1,3 @@
[default]
ENVIRONMENT = dev
DEBUG = true

0
config/ci.ini Normal file
View File