示例#1
0
文件: app.py 项目: tornaria/seminars
app.is_running = False


def set_running():
    app.is_running = True


def is_running():
    return app.is_running


############################
# Global app configuration #
############################

app.logger.addHandler(logger_file_handler())

# If the debug toolbar is installed then use it
if app.debug:
    try:
        from flask_debugtoolbar import DebugToolbarExtension
        app.config["SECRET_KEY"] = """shh, it's a secret"""
        toolbar = DebugToolbarExtension(app)
    except ImportError:
        pass

# secret key, necessary for sessions and tokens
# sessions are in turn necessary for users to login
from lmfdb.utils.config import get_secret_key
app.secret_key = get_secret_key()
示例#2
0
文件: app.py 项目: davidfarmer/lmfdb
def is_beta():
    from flask import g
    return g.BETA

app.is_running = False
def set_running():
    app.is_running = True
def is_running():
    return app.is_running

############################
# Global app configuration #
############################

app.logger.addHandler(logger_file_handler())

# If the debug toolbar is installed then use it
if app.debug:
    try:
        from flask_debugtoolbar import DebugToolbarExtension
        app.config['SECRET_KEY'] = '''shh, it's a secret'''
        toolbar = DebugToolbarExtension(app)
    except ImportError:
        pass

# tell jinja to remove linebreaks
app.jinja_env.trim_blocks = True

# enable break and continue in jinja loops
app.jinja_env.add_extension('jinja2.ext.loopcontrols')