2016-06-28 21 views
1

Why is Django blocktrans working one place and not another?中,我问了一个类似的问题,并在“使用i18n”响应之后接受了解决相关问题的答案。在这里,我得到的Pinax 0.9a1的模板TemplateSyntaxError对看到的给定用户的追随者:我如何获得这个Django模板来呈现?

{% extends "microblogging/base.html" %} 

{% load i18n %} 
{% load avatar_tags %} 
{% load account_tags %} 

{% user_display other_user as other_user_display %} 

{% block head_title %}{% blocktrans %}Followers of {{ other_user_display }}{% endblocktrans %}{% endblock %} 

的错误是:

TemplateSyntaxError at /tweets/followers/ABC/ 
Caught KeyError while rendering: u'other_user_display' 

如果我正确地读模板,下模板中的最后(非空白)行定义了other_user_displayuser_display()lib/python2.7/site-packages/pinax/apps/account/utils.py中定义。

还有什么需要做的,使user_display other_user/other_user_display可用?

回答