Hello,

I want to simply render a built-in comment form in a template, using
Django's builtin commenting module, but this returns a
TemplateSyntaxError Exception.

I need help debugging this error, please, because after googling and
using the Django API reference, I'm still not getting any farther.

Info [http://pastebin.com/m189a1af3]: 

This is the template '_post.html'[shortened]:
<div id="post_{{ object.id }}">
<h2>
    <a href="{% url post object.id %}">{{ object.title }}</a>
    <small>{{ object.pub_date|timesince }} ago</small>
    </h2>
    {{ object.body }}
    {% load comments %}
    {% get_comment_count for object as comment_count %}
    <p>{{ comment_count }}</p>
    <!-- Returns 0, because no comments available  -->
    {% render_comment_form for object %}
    <!-- Returns TemplateSyntaxError -->

This is the Exception output, when rendering:

Caught an exception while rendering: Reverse for
'django.contrib.comments.views.comments.post_comment' with arguments
'()' and keyword arguments '{}' not found.1 {% load comments i18n %}
        <form action="{% comment_form_target %}" method="post">
          {% if next %}<input type="hidden" name="next"
value="{{ next }}" />{% endif %} {% for field in form %}
            {% if field.is_hidden %}
              {{ field }}
            {% else %}
          {% if field.errors %}{{ field.errors }}{% endif %}
          <p
            {% if field.errors %} class="error"{% endif %}
            {% ifequal field.name "honeypot" %} style="display:none;"{%
endifequal %}> {{ field.label_tag }} {{ field }}

/posts/urls.py[shortened]:
queryset = {'queryset': Post.objects.all(),
            'extra_context' : {"tags" : get_tags}
           }   
urlpatterns = patterns('django.views.generic.list_detail',
    url('^$',                           'object_list',      queryset,
        name='posts'),
    url('^blog/(?P<object_id>\d+)/$',   'object_detail',    queryset,
        name='post'),
)

/urls.py[shortened]:
urlpatterns = patterns('',
    (r'', include('posts.urls')),
    (r'^comments/$', include('django.contrib.comments.urls')),
)


--------------------------------------------------------------------
  .'  `.    knny [d0t] myer [at] gmail [d0t] com 
  |a_a  |   http://kenny.paraguayinfos.de | gpg key ID: 0x00F56BA1B2
  \<_)__/   -------------------------------------------------------- 
  /(   )\   Everything should be made as simple as possible, but not 
 |\`> < /\                        simpler.
 \_|=='|_/                                        -- Albert Einstein 

Attachment: signature.asc
Description: PGP signature

Reply via email to