Обновить src/myapp/__init__.py
This commit is contained in:
@@ -7,6 +7,8 @@ import logging
|
||||
from flask import Flask
|
||||
from logging.handlers import RotatingFileHandler
|
||||
|
||||
from myapp.core import config
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config.CONFIG)
|
||||
@@ -15,12 +17,12 @@ app.config.from_envvar('FLASKR_SETTINGS', silent=True)
|
||||
|
||||
# Логирование
|
||||
handler = RotatingFileHandler(
|
||||
app.config['LOG_FILE'],
|
||||
maxBytes=app.config['LOG_FILE_SIZE']*1024*1024,
|
||||
config['LOG_FILE'],
|
||||
maxBytes=config['LOG_FILE_SIZE']*1024*1024,
|
||||
backupCount=1
|
||||
)
|
||||
handler.setLevel(logging.INFO)
|
||||
formatter = logging.Formatter(app.config['LONG_LOG_FORMAT'])
|
||||
formatter = logging.Formatter(config['LONG_LOG_FORMAT'])
|
||||
handler.setFormatter(formatter)
|
||||
app.logger.addHandler(handler)
|
||||
|
||||
@@ -32,8 +34,8 @@ from . import lib, models
|
||||
def inject_data():
|
||||
result = {}
|
||||
|
||||
result['STATIC'] = app.config['STATIC']
|
||||
result['ITEMS_ON_PAGE'] = app.config['ITEMS_ON_PAGE']
|
||||
result['STATIC'] = config['STATIC']
|
||||
result['ITEMS_ON_PAGE'] = config['ITEMS_ON_PAGE']
|
||||
|
||||
result['user'] = None
|
||||
if lib.get_user():
|
||||
|
||||
Reference in New Issue
Block a user