コード例 #1
0
ファイル: app_cfg.py プロジェクト: axant/molepaw
def enable_debugbar():
    try:
        # Enable DebugBar if available, install tgext.debugbar to turn it on
        if not tg.config.get("disabled_debugbar", False):
            from tgext.debugbar import enable_debugbar
            enable_debugbar(base_config)
    except ImportError:  # pragma: no cover
        pass
コード例 #2
0
ファイル: app_cfg.py プロジェクト: BenoitEchernier/web
# This might happen if logged-in users are deleted.
base_config['identity.allow_missing_user'] = False

# You can use a different repoze.who Authenticator if you want to
# change the way users can login
# base_config.sa_auth.authenticators = [('myauth', SomeAuthenticator()]

# You can add more repoze.who metadata providers to fetch
# user metadata.
# Remember to set base_config.sa_auth.authmetadata to None
# to disable authmetadata and use only your own metadata providers
# base_config.sa_auth.mdproviders = [('myprovider', SomeMDProvider()]

# override this if you would like to provide a different who plugin for
# managing login and logout of your application
base_config.sa_auth.form_plugin = None

# You may optionally define a page where you want users to be redirected to
# on login:
base_config.sa_auth.post_login_url = '/post_login'

# You may optionally define a page where you want users to be redirected to
# on logout:
base_config.sa_auth.post_logout_url = '/post_logout'
try:
    # Enable DebugBar if available, install tgext.debugbar to turn it on
    from tgext.debugbar import enable_debugbar
    enable_debugbar(base_config)
except ImportError:
    pass
コード例 #3
0
ファイル: app_cfg.py プロジェクト: vzhz/function_generator
# This might happen if logged-in users are deleted.
base_config['identity.allow_missing_user'] = False

# You can use a different repoze.who Authenticator if you want to
# change the way users can login
# base_config.sa_auth.authenticators = [('myauth', SomeAuthenticator()]

# You can add more repoze.who metadata providers to fetch
# user metadata.
# Remember to set base_config.sa_auth.authmetadata to None
# to disable authmetadata and use only your own metadata providers
# base_config.sa_auth.mdproviders = [('myprovider', SomeMDProvider()]

# override this if you would like to provide a different who plugin for
# managing login and logout of your application
base_config.sa_auth.form_plugin = None

# You may optionally define a page where you want users to be redirected to
# on login:
base_config.sa_auth.post_login_url = '/post_login'

# You may optionally define a page where you want users to be redirected to
# on logout:
base_config.sa_auth.post_logout_url = '/post_logout'
try:
    # Enable DebugBar if available, install tgext.debugbar to turn it on
    from tgext.debugbar import enable_debugbar
    enable_debugbar(base_config)
except ImportError:
    pass
コード例 #4
0
ファイル: app_cfg.py プロジェクト: bbcf/bs
 def after_init_config(self):
     s = 'debug.toolbar'
     if s in tg.config and tg.config[s].lower() in ['true', 'yes']:
         from tgext.debugbar import enable_debugbar
         enable_debugbar(base_config)
コード例 #5
0
 def after_init_config(self):
     s = 'debug.toolbar'
     if s in tg.config and tg.config[s].lower() in ['true', 'yes']:
         from tgext.debugbar import enable_debugbar
         enable_debugbar(base_config)