本文整理汇总了Python中tg.configuration.AppConfig.profile方法的典型用法代码示例。如果您正苦于以下问题:Python AppConfig.profile方法的具体用法?Python AppConfig.profile怎么用?Python AppConfig.profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tg.configuration.AppConfig
的用法示例。
在下文中一共展示了AppConfig.profile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CSRFMetadataProvider
# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import profile [as 别名]
# this makes sure the passwords are not stored in clear-text
# inside the database. Choices are "md5", "sha1" or "salted_sha1"
base_config.sa_auth.password_encryption_method = "salted_sha1"
base_config.sa_auth.cookie_secret = "/\\/\\0|<5|-|4"
# 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'
# Add Moksha's CSRF protection middleware by default
from moksha.middleware.csrf import CSRFMetadataProvider
base_config.sa_auth.mdproviders = [('csrfmd', CSRFMetadataProvider())]
# To enable the repoze.profile middleware.
# After surfing around, navigate to /__profile__ to view results.
base_config.profile = False
# Enable repoze.squeeze resource squeezing middleware
base_config.squeeze = False
from moksha import shutdown
base_config.call_on_shutdown.append(shutdown)