Closed ziweizhou closed 10 years ago
Hello,
Without traceback, I can do nothing for you. And django-cms 3.0beta is not tested with Zinnia or cmsplugin-zinnia, because I don't have the time to support beta versions.
Because this issue don't happen with the django-cms 2.x releases, report the issue on their page.
Sorry, following is the traceback, if you think that I should post on their website, I will do that as well. Thanks for your help
LINE 79 : {% if perms.zinnia %} got the error.
Environment:
Request Method: GET
Request URL: http://tourguide-test.triosky.com/en/blog/?edit_off
Django Version: 1.6.2
Python Version: 2.7.3
Installed Applications:
('djangocms_admin_style',
'djangocms_text_ckeditor',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.comments',
'south',
'rest_framework',
'slugify',
'sorl.thumbnail',
'debug_toolbar',
'customauth',
'tours',
'photos',
'trips',
'geowiki',
'rosetta',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.weibo',
'cms',
'mptt',
'menus',
'sekizai',
'raven.contrib.django.raven_compat',
'reversion',
'storages',
'djangocms_style',
'djangocms_column',
'djangocms_inherit',
'djangocms_link',
'djangocms_twitter',
'filer',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_video',
'tagging',
'zinnia',
'cmsplugin_zinnia')
Installed Middleware:
('raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware',
'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.doc.XViewMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')
Template error:
In template /sites/.virtualenvs/tour/local/lib/python2.7/site-packages/zinnia/templates/zinnia/base.html, error at line 79
__nonzero__ should return bool or int, returned instancemethod
69 : {% get_popular_entries %}
70 : </div>
71 : <div id="widget-archives" class="widget">
72 : <h3>{% trans "Archives" %}</h3>
73 : {% get_archives_entries_tree %}
74 : </div>
75 : {% if user.is_authenticated %}
76 : <div id="widget-tools" class="widget">
77 : <h3>{% trans "Tools" %}</h3>
78 : <ul>
79 : {% if perms.zinnia %}
80 : <li>
81 : <a href="{% url 'admin:app_list' 'zinnia' %}" title="{% trans "Dashboard" %}">
82 : {% trans "Dashboard" %}
83 : </a>
84 : </li>
85 : {% endif %}
86 : {% if perms.zinnia.add_entry %}
87 : <li>
88 : <a href="{% url 'admin:zinnia_entry_add' %}" title="{% trans "Post an entry" %}">
89 : {% trans "Post an entry" %}
Traceback:
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
139. response = response.render()
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/response.py" in render
105. self.content = self.rendered_content
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
82. content = template.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
140. return self._render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
85. return self.nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
123. return compiled_parent._render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
85. return self.nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
123. return compiled_parent._render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
85. return self.nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
123. return compiled_parent._render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/test/utils.py" in instrumented_test_render
85. return self.nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
62. result = block.nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
305. return nodelist.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/sites/.virtualenvs/tour/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
304. if match:
Exception Type: TypeError at /en/blog/
Exception Value: __nonzero__ should return bool or int, returned instancemethod
From the traceback the issue is really weird. I don't think that the cms is causing it. Certainly a problem a the project level. You have to investigate yourself for solving this issue.
Hi
I am using django-cms 3.0beta and zinnia 0.15.dev. I got following error when I am trying to access it from the admin page.