本文整理汇总了Python中aspen.website.Website.db方法的典型用法代码示例。如果您正苦于以下问题:Python Website.db方法的具体用法?Python Website.db怎么用?Python Website.db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspen.website.Website
的用法示例。
在下文中一共展示了Website.db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_version
# 需要导入模块: from aspen.website import Website [as 别名]
# 或者: from aspen.website.Website import db [as 别名]
# Wireup Algorithm
# ================
exc = None
try:
website.version = get_version()
except Exception, e:
exc = e
website.version = 'x'
env = website.env = gratipay.wireup.env()
tell_sentry = website.tell_sentry = gratipay.wireup.make_sentry_teller(env)
website.db = gratipay.wireup.db(env)
website.mailer = gratipay.wireup.mail(env, website.project_root)
gratipay.wireup.base_url(website, env)
gratipay.wireup.secure_cookies(env)
gratipay.wireup.billing(env)
gratipay.wireup.team_review(env)
gratipay.wireup.username_restrictions(website)
gratipay.wireup.load_i18n(website.project_root, tell_sentry)
gratipay.wireup.other_stuff(website, env)
gratipay.wireup.accounts_elsewhere(website, env)
gratipay.wireup.cryptocoin_networks(website)
if exc:
tell_sentry(exc, {})
示例2: Cron
# 需要导入模块: from aspen.website import Website [as 别名]
# 或者: from aspen.website.Website import db [as 别名]
'Community': Community,
'b64decode': base64.b64decode,
'b64encode': base64.b64encode,
'filter_profile_subnav': utils.filter_profile_subnav,
'to_javascript': utils.to_javascript,
'urlquote': urlquote,
})
# Wireup Algorithm
# ================
env = website.env = wireup.env()
tell_sentry = website.tell_sentry = wireup.make_sentry_teller(env)
wireup.canonical(env)
website.db = wireup.db(env)
website.mailer = wireup.mail(env, website.project_root)
wireup.billing(env)
wireup.username_restrictions(website)
wireup.load_i18n(website.project_root, tell_sentry)
wireup.other_stuff(website, env)
wireup.accounts_elsewhere(website, env)
# Periodic jobs
# =============
cron = Cron(website)
cron(env.update_global_stats_every, lambda: utils.update_global_stats(website))
cron(env.check_db_every, website.db.self_check, True)
cron(env.dequeue_emails_every, Participant.dequeue_emails, True)