Hi,
Updated to 8613 with the release of Django 1.0 Beta 2 and saw the
addition of commenting framework - tried to add it and am getting a
similar error to above.
I tried this (even though I did not use the old commenting system).
Here is the exception information...
----------------------------------------------------------------------------------------------------
Environment:
Request Method: GET
Request URL:
http://localhost/apps/buildboard/builddetails/80/
Django Version: 1.0-beta_1-SVN-unknown
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django_apps.buildboard',
'django_xmlrpc',
'django.contrib.comments']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware')
Template error:
In template c:\_tools\python251\lib\site-packages\django\contrib
\comments\templates\comments\form.html, error at line 2
Caught an exception while rendering: Reverse for '<function
post_comment at 0x0158BEF0>' not found.
1 : {% load comments %}
2 : <form action=" {% comment_form_target %} " method="POST">
3 : {% for field in form %}
4 : {% if field.is_hidden %}
5 : {{ field }}
6 : {% else %}
7 : <p
8 : {% if field.errors %} class="error"{% endif %}
9 : {% ifequal
field.name "honeypot" %}
style="display:none;"{% endifequal %}>
10 : {% if field.errors %}{{ field.errors }}{% endif %}
11 : {{ field.label_tag }} {{ field }}
12 : </p>
Traceback:
File "c:\_tools\python251\lib\site-packages\django\core\handlers
\base.py" in get_response
86. response = callback(request, *callback_args,
**callback_kwargs)
File "c:\_tools\python251\lib\site-packages\django\contrib\auth
\decorators.py" in __call__
67. return self.view_func(request, *args, **kwargs)
File "c:\_projects\django_apps\..\django_apps\buildboard\views.py" in
build_details
309. print t.render(c)
File "c:\_tools\python251\lib\site-packages\django\template
\__init__.py" in render
176. return self.nodelist.render(context)
File "c:\_tools\python251\lib\site-packages\django\template
\__init__.py" in render
756. bits.append(self.render_node(node, context))
File "c:\_tools\python251\lib\site-packages\django\template\debug.py"
in render_node
71. result = node.render(context)
File "c:\_tools\python251\lib\site-packages\django\contrib\comments
\templatetags\comments.py" in render
158. formstr = render_to_string(template_search_list,
{"form" : self.get_form(context)}, context)
File "c:\_tools\python251\lib\site-packages\django\template\loader.py"
in render_to_string
107. return t.render(context_instance)
File "c:\_tools\python251\lib\site-packages\django\template
\__init__.py" in render
176. return self.nodelist.render(context)
File "c:\_tools\python251\lib\site-packages\django\template
\__init__.py" in render
756. bits.append(self.render_node(node, context))
File "c:\_tools\python251\lib\site-packages\django\template\debug.py"
in render_node
81. raise wrapped
Exception Type: TemplateSyntaxError at /apps/buildboard/builddetails/
80/
Exception Value: Caught an exception while rendering: Reverse for
'<function post_comment at 0x0158BEF0>' not found.
Original Traceback (most recent call last):
File "c:\_tools\python251\lib\site-packages\django\template
\debug.py", line 71, in render_node
result = node.render(context)
File "c:\_tools\python251\lib\site-packages\django\template
\__init__.py", line 876, in render
return func(*resolved_vars)
File "c:\_tools\python251\lib\site-packages\django\contrib\comments
\templatetags\comments.py", line 245, in comment_form_target
return comments.get_form_target()
File "c:\_tools\python251\lib\site-packages\django\contrib\comments
\__init__.py", line 50, in get_form_target
return
urlresolvers.reverse("django.contrib.comments.views.comments.post_comment")
File "c:\_tools\python251\lib\site-packages\django\core
\urlresolvers.py", line 307, in reverse
*args, **kwargs)))
File "c:\_tools\python251\lib\site-packages\django\core
\urlresolvers.py", line 291, in reverse
raise NoReverseMatch("Reverse for '%s' not found." % lookup_view)
NoReverseMatch: Reverse for '<function post_comment at 0x0158BEF0>'
not found.
----------------------------------------------------------------------------------------------------
The code that is causing this... (in a view method for debug
purposes...)
from django.template import Template, Context
t=Template('{% load comments %}{% render_comment_form for
buildboard.build 1 %}') # also tried using model instance, with
appropriate context entry.
c=Context({})
print t.render(c)
Do you need more information from me?
Thanks
Mark