forked from andreeuuetoa/litsimaja
Create .env for config
This commit is contained in:
@@ -7,9 +7,12 @@ from lib.Litsimaja import Litsimaja
|
||||
from flask import Flask, request, Response, render_template, json
|
||||
from flask_accept import accept
|
||||
|
||||
# start litsimaja
|
||||
lm = Litsimaja()
|
||||
|
||||
# logging
|
||||
logger = logging.getLogger('litsimaja')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.setLevel(logging.DEBUG if lm.conf('IS_DEV') else logging.WARN)
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
file_handler = logging.FileHandler('litsimaja.log')
|
||||
file_handler.setFormatter(formatter)
|
||||
@@ -18,8 +21,6 @@ stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setFormatter(formatter)
|
||||
logger.addHandler(stdout_handler)
|
||||
|
||||
# start litsimaja
|
||||
lm = Litsimaja()
|
||||
app = Flask(__name__, static_url_path='', static_folder='templates')
|
||||
Pl.run('siinus', 'Wipes', lm, logger, {'color': [0, 0, 0]})
|
||||
Pl.run('peter', 'DiskoPidu', lm, logger, {})
|
||||
@@ -79,4 +80,4 @@ def sync_beat():
|
||||
return lm_standard_xhr_response()
|
||||
|
||||
|
||||
app.run('0.0.0.0', 8080)
|
||||
app.run(lm.conf('BIND_ADDR'), lm.conf('BIND_PORT'))
|
||||
|
||||
Reference in New Issue
Block a user