mailing.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:api-django 作者: lafranceinsoumise 项目源码 文件源码
def get_context_from_bindings(code, recipient, bindings):
    """Finalizes the bindings and create a Context for templating
    """
    if code not in settings.EMAIL_TEMPLATES:
        raise ImproperlyConfigured("Mail '%s' cannot be found")

    url = settings.EMAIL_TEMPLATES[code]

    res = dict(bindings)
    res['EMAIL'] = recipient

    qs = QueryDict(mutable=True)
    qs.update(res)

    # We first initialize the LINK_BROWSER variable as "#" (same page)
    qs['LINK_BROWSER'] = "#"
    # we generate the final browser link and add it to result dictionary
    res['LINK_BROWSER'] = f"{url}?{qs.urlencode()}"

    return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号