django allauth模板标签在自定义模板中不起作用

时间:2020-04-18 23:24:56

标签: django django-templates django-allauth django-template-filters

我在verification_sent.html文件中添加了以下代码。但是模板标记不适用于模板。

# templates/account/verification_sent.html
{% extends 'account/base.html' %}
{% load i18n %}

{% block content %}
    <h1>{% trans "Verify Your E-mail Address" %}</h1>
    {% load account %}
    {% user_display user as user_display %}
    {% blocktrans %}{{ user_display }}, Confirmation email has been sent to your email address{% endblocktrans %}
{% endblock content %}

结果显示如下

Verify Your E-mail Address
AnonymousUser, Confirmation email has been sent to your email address.

如何从模板文件中获取注册用户的全名和电子邮件地址?

0 个答案:

没有答案