#8571: comment framework throws obscure exception in {% comment_form_target %}
----------------------------------------------+-----------------------------
          Reporter:  [EMAIL PROTECTED]         |         Owner:  nobody         
             
            Status:  reopened                 |     Milestone:  post-1.0        
            
         Component:  django.contrib.comments  |       Version:  1.0             
            
        Resolution:                           |      Keywords:  comment, 
comment_form_target
             Stage:  Unreviewed               |     Has_patch:  0               
            
        Needs_docs:  0                        |   Needs_tests:  0               
            
Needs_better_patch:  0                        |  
----------------------------------------------+-----------------------------
Changes (by hannnndy <[EMAIL PROTECTED]>):

  * status:  closed => reopened
  * resolution:  worksforme =>

Comment:

 I have this problem too

 Please help:

 my setting file Installed apps:
 {{{
 INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
         'models.news',
         'models.link',
         'models.poll',
         'models.about',
         'models.contact',
         'django.contrib.admin',
         'django.contrib.comments',INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
         'models.news',
         'models.link',
         'models.poll',
         'models.about',
         'models.contact',
         'django.contrib.admin',
         'django.contrib.comments',
 }}}
 generated error :


 TemplateSyntaxError at /news/1/

 Caught an exception while rendering: Reverse for '<function post_comment
 at 0x0175EE30>' with arguments '()' and keyword arguments '{}' not found.

 Original Traceback (most recent call last):
   File "c:\python25\lib\site-packages\django\template\debug.py", line 71,
 in render_node
     result = node.render(context)
   File "c:\python25\lib\site-packages\django\template\__init__.py", line
 888, in render
     return func(*resolved_vars)
   File "c:\python25\lib\site-
 packages\django\contrib\comments\templatetags\comments.py", line 246, in
 comment_form_target
     return comments.get_form_target()
   File "c:\python25\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:\python25\lib\site-packages\django\core\urlresolvers.py", line
 252, in reverse
     *args, **kwargs)))
   File "c:\python25\lib\site-packages\django\core\urlresolvers.py", line
 241, in reverse
     "arguments '%s' not found." % (lookup_view, args, kwargs))
 NoReverseMatch: Reverse for '<function post_comment at 0x0175EE30>' with
 arguments '()' and keyword arguments '{}' not found.

 Request Method:         GET
 Request URL:    http://127.0.0.1:8000/news/1/
 Exception Type:         TemplateSyntaxError
 Exception Value:

 Caught an exception while rendering: Reverse for '<function post_comment
 at 0x0175EE30>' with arguments '()' and keyword arguments '{}' not found.

 Original Traceback (most recent call last):
   File "c:\python25\lib\site-packages\django\template\debug.py", line 71,
 in render_node
     result = node.render(context)
   File "c:\python25\lib\site-packages\django\template\__init__.py", line
 888, in render
     return func(*resolved_vars)
   File "c:\python25\lib\site-
 packages\django\contrib\comments\templatetags\comments.py", line 246, in
 comment_form_target
     return comments.get_form_target()
   File "c:\python25\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:\python25\lib\site-packages\django\core\urlresolvers.py", line
 252, in reverse
     *args, **kwargs)))
   File "c:\python25\lib\site-packages\django\core\urlresolvers.py", line
 241, in reverse
     "arguments '%s' not found." % (lookup_view, args, kwargs))
 NoReverseMatch: Reverse for '<function post_comment at 0x0175EE30>' with
 arguments '()' and keyword arguments '{}' not found.

 Exception Location:     c:\python25\lib\site-
 packages\django\template\debug.py in render_node, line 81
 Python Executable:      c:\python25\python.exe
 Python Version:         2.5.2
 Python Path:    ['C:\\Documents and Settings\\Mohammad\\Desktop\\witna',
 'C:\\WINDOWS\\system32\\python25.zip', 'c:\\python25\\DLLs',
 'c:\\python25\\lib', 'c:\\python25\\lib\\plat-win', 'c:\\python25\\lib
 \\lib-tk', 'c:\\python25', 'c:\\python25\\lib\\site-packages',
 'c:\\python25\\lib\\site-packages\\PIL', 'c:\\python25\\lib\\site-
 packages\\wx-2.8-msw-unicode']
 Server time:    Sun, 26 Oct 2008 13:12:02 +0330
 Template error

 In template c:\python25\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 0x0175EE30>' with arguments '()' and keyword arguments '{}' 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>

 in template file usage:

 {{{
                 <b>{{ news.super_title }}</b>
                 <h1>{{ news.title }}</h1>
                 <br>
                 <em>{{ news.abstract }}</em>
                 <br>
                 <br>
                 {{ news.body|linebreaksbr }}
                 <br>
                 <br>
                 <a href="../"> بازگشت </a>
                 {% load comments %}

                 {% get_comment_count for news as comment_count %}

                 <p>This news has {{ comment_count }} comments.</p>

                 {% render_comment_form for news.News news.id %}
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8571#comment:22>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to