Files @ 25d132386b75
Branch filter:

Location: FVDE/ennstatus/ennstatus/config.py

Dennis Fink
Merge hotfix-update-flags
# Ënnstatus
# Copyright (C) 2015  Dennis Fink
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import base64


def init_app(app):

    config = app.config

    _default_secret_key = base64.b64encode(os.urandom(32)).decode('utf-8')

    config['SECRET_KEY'] = os.environ.get('SECRET_KEY', _default_secret_key)

    # Flask-Bootstrap
    config.setdefault('BOOTSTRAP_SERVE_LOCAL', True)

    # ennstatus

    # moment.js string formatting
    # http://momentjs.com/docs/#/displaying/format/
    config.setdefault('ENNSTATUS_MOMENTJS_FORMAT', 'DD MMMM YYYY HH:mm:ss')

    config.setdefault('ENNSTATUS_STRFTIME_FORMAT', '%d %B %Y %H:%M:%S')