我在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.
如何从模板文件中获取注册用户的全名和电子邮件地址?