首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >怎样才能让这个Django模板呈现出来?

怎样才能让这个Django模板呈现出来?
EN

Stack Overflow用户
提问于 2016-06-29 02:15:27
回答 0查看 117关注 0票数 1

Why is Django blocktrans working one place and not another?中,我提出了类似的问题,并在"use i18n“响应解决了相关行为后接受了回答。在这里,我在Pinax0.9a1的模板中获取了一个TemplateSyntaxError,用于查看给定用户的关注者:

代码语言:javascript
复制
{% 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 %}

错误是:

代码语言:javascript
复制
TemplateSyntaxError at /tweets/followers/ABC/
Caught KeyError while rendering: u'other_user_display'

如果我没看错模板,模板中的倒数第二行(非空格)定义了other_user_display。在lib/python2.7/site-packages/pinax/apps/account/utils.py中定义了user_display()

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

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38083483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档