1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-22 03:39:05 +02:00

Finish the configuration bits

This commit is contained in:
kaiyou 2018-11-08 20:29:52 +01:00
parent 82069ea3f0
commit 206cce0b47
2 changed files with 7 additions and 3 deletions

@ -20,8 +20,9 @@ def create_app_from_config(config):
utils.limiter.init_app(app)
utils.babel.init_app(app)
utils.login.init_app(app)
utils.login.user_loader(models.User.query.get)
utils.login.user_loader(models.User.get)
utils.proxy.init_app(app)
utils.migrate.init_app(app, models.db)
# Initialize debugging tools
if app.config.get("DEBUG"):

@ -4,7 +4,7 @@ import os
DEFAULT_CONFIG = {
# Specific to the admin UI
'SQLALCHEMY_DATABASE_URI': 'sqlite:////data/main.db',
'SQLALCHEMY_TRACK_MODIFICATIONS': True,
'SQLALCHEMY_TRACK_MODIFICATIONS': False,
'DOCKER_SOCKET': 'unix:///var/run/docker.sock',
'BABEL_DEFAULT_LOCALE': 'en',
'BABEL_DEFAULT_TIMEZONE': 'UTC',
@ -54,7 +54,7 @@ DEFAULT_CONFIG = {
}
class ConfigManager(object):
class ConfigManager(dict):
""" Naive configuration manager that uses environment only
"""
@ -77,6 +77,9 @@ class ConfigManager(object):
def get(self, *args):
return self.config.get(*args)
def keys(self):
return self.config.keys()
def __getitem__(self, key):
return self.config.get(key)