forked from EpocDotFr/webtodotxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webtodotxt.py
41 lines (28 loc) · 955 Bytes
/
webtodotxt.py
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
30
31
32
33
34
35
36
37
38
39
40
41
from logging.handlers import RotatingFileHandler
from flask_httpauth import HTTPBasicAuth
from flask_babel import Babel
from flask import Flask
import logging
# -----------------------------------------------------------
# Boot
app = Flask(__name__, static_url_path='')
app.config.from_pyfile('config.py')
if not app.config['TITLE']:
app.config['TITLE'] = 'Web Todo.txt'
app.config['LANGUAGES'] = {
'en': 'English',
'fr': 'Français',
'pt': 'Portuguese'
}
babel = Babel(app)
auth = HTTPBasicAuth()
handler = RotatingFileHandler('storage/logs/errors.log', maxBytes=10000000, backupCount=2)
handler.setLevel(logging.WARNING)
formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s', datefmt='%d/%m/%Y %H:%M:%S')
handler.setFormatter(formatter)
app.logger.addHandler(handler)
from helpers import *
# -----------------------------------------------------------
# After-init imports
import routes
import hooks