本文整理汇总了Python中django.contrib.sites.requests.RequestSite方法的典型用法代码示例。如果您正苦于以下问题:Python requests.RequestSite方法的具体用法?Python requests.RequestSite怎么用?Python requests.RequestSite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.contrib.sites.requests
的用法示例。
在下文中一共展示了requests.RequestSite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resend_activation_email
# 需要导入模块: from django.contrib.sites import requests [as 别名]
# 或者: from django.contrib.sites.requests import RequestSite [as 别名]
def resend_activation_email(self, request, queryset):
"""
Re-sends activation emails for the selected users.
Note that this will *only* send activation emails for users
who are eligible to activate; emails will not be sent to users
whose activation keys have expired or who have already
activated.
"""
if apps.is_installed('django.contrib.sites'):
site = apps.get_model('sites', 'Site').objects.get_current()
else:
site = RequestSite(request)
for profile in queryset:
user = profile.user
RegistrationProfile.objects.resend_activation_mail(
user.email, site, request)