Made timezone configurable

This commit is contained in:
root 2023-06-02 20:40:30 +02:00
parent 93ed8ec95b
commit fad54a6472
2 changed files with 2 additions and 2 deletions

View File

@ -2,3 +2,4 @@
title = A oder B title = A oder B
separator = oder separator = oder
separator_char = ; separator_char = ;
timezone = Europe/Berlin

View File

@ -16,7 +16,7 @@ config = ConfigParser()
config.read('config.ini') config.read('config.ini')
logging.basicConfig(encoding='utf-8', level=logging.INFO, format='%(message)s') logging.basicConfig(encoding='utf-8', level=logging.INFO, format='%(message)s')
logger = logging.getLogger('waitress') logger = logging.getLogger('waitress')
tz = pytz.timezone('Europe/Berlin') tz = pytz.timezone(config.get('main', 'timezone')
@app.after_request @app.after_request
def log_the_request(response): def log_the_request(response):
@ -57,7 +57,6 @@ def log_the_request(response):
logfile = "{} - {} [{}] \"{} {}\" {} {} \"{}\" \"{}\"".format(log['remote_addr'], log['remote_user'], log['date'], log['method'], log['url'], log['status_code'], log['content_length'], log['referrer'], log['user_agent']) logfile = "{} - {} [{}] \"{} {}\" {} {} \"{}\" \"{}\"".format(log['remote_addr'], log['remote_user'], log['date'], log['method'], log['url'], log['status_code'], log['content_length'], log['referrer'], log['user_agent'])
logger.info(logfile) logger.info(logfile)
return response return response
@app.route("/") @app.route("/")