我目前正在浏览django-cms-demo。我一直在使用这里找到的代码:
https://github.com/andrewschoen/django-cms-demo/tree/master/demo。
在添加投票应用插件之前,我有此工作。当我在django-admin中添加Poll app插件时,我得到了反向匹配错误。经过几次修复后,我开始收到以下错误:
"模板标记无法找到包含查找参数
{'reverse_id': u'home', 'site': 1}
的页面。该请求的网址为:' http'://example.com/en-us/"
回溯:
环境:
请求方法:GET 请求网址:' http':// 123.0.0.1:8888 / zh-CN /
Django Version: 1.5.5
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'cms',
'mptt',
'menus',
'south',
'sekizai',
'reversion',
'cms.plugins.text',
'polls',
'filer',
'easy_thumbnails',
'cms.plugins.link',
'cms.plugins.picture',
'tinymce',
'djangocms_column',
'cmsplugin_filer_file',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_folder',
'cmsplugin_filer_video')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')
模板错误:
在模板/home/vagrant/django_cms/demo_cms/templates/subpage_base.html中,第26行的错误
模板标记无法找到包含查找参数{'reverse_id': u'home', 'site': 1}
的页面。请求的网址为:' http'://example.com/en-us/
16:
17:{%placeholder sidebar%}
18:
19:
20:{%block sub_content%} {%endblock%}
21:
22:
23:{%endblock%}
24:
25:{%block footer%}
26:{%show_placeholder'页脚' '家' %}
27:{%endblock%}
28:
29:
回溯: 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/core/handlers/base.py"在get_response中 140. response = response.render() 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/response.py"在渲染中 105. self.content = self.rendered_content 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/response.py"在rendered_content中 82. content = template.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 140. return self._render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在_render 134. return self.nodelist.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 830. bit = self.render_node(node,context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/debug.py"在render_node中 74. return node.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/loader_tags.py"在渲染中 124. return compiled_parent._render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在_render 134. return self.nodelist.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 830. bit = self.render_node(node,context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/debug.py"在render_node中 74. return node.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/loader_tags.py"在渲染中 124. return compiled_parent._render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在_render 134. return self.nodelist.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 830. bit = self.render_node(node,context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/debug.py"在render_node中 74. return node.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/classytags/core.py"在渲染中 106. return self.render_tag(context,** kwargs) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py"在render_tag中 76. rendered_contents = nodelist.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 830. bit = self.render_node(node,context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/debug.py"在render_node中 74. return node.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/loader_tags.py"在渲染中 63. result = block.nodelist.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/base.py"在渲染中 830. bit = self.render_node(node,context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/django/template/debug.py"在render_node中 74. return node.render(context) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/classytags/core.py"在渲染中 106. return self.render_tag(context,** kwargs) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/classytags/helpers.py"在render_tag中 75. data = self.get_context(context,** kwargs) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py"在get_context中 468. return _show_placeholder_for_page(** self.get_kwargs(* args,** kwargs)) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py"在_show_placeholder_for_page中 436. page = _get_page_by_untyped_arg(page_lookup,request,site_id) 文件" /home/vagrant/django_cms/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py"在_get_page_by_untyped_arg中 107.提高Page.DoesNotExist(正文)
异常类型:在/ en-us /中的DoesNotExist
异常值:模板标记无法找到包含查找参数{'reverse_id': u'home', 'site': 1}
的页面。请求的网址为:' http'://example.com/en-us/
答案 0 :(得分:2)
变化:
{% show_placeholder 'footer' 'home' %}
为:
{% show_placeholder 'footer' %}
或在您的id
页面高级设置home
home