django-fluent/django-fluent-comments

AJAX and threaded comments not working

mayuroks opened this issue · 8 comments

I am trying to use django-fluent-comments along with Django 1.6. I tried following their github README tutorial for setting it up but some features like threaded comments and AJAX are not working.

my settings.py has this

INSTALLED_APPS += (
        'fluent_comments',
        'crispy_forms',
        'django.contrib.comments',
        'threadedcomments',
)
COMMENTS_APP = 'fluent_comments'

urls.py has this

urlpatterns += patterns('',
    url(r'^blog/comments/', include('fluent_comments.urls')),
)

my template post_details.html

<html>
{% load comments %}
<head>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}fluent_comments/css/ajaxcomments.css" />
</head>
<body>
<h1>{{post.title}}</h1>
<p>{{post.body}}</p>


<script type="text/javascript" src="{{ STATIC_URL }}fluent_comments/js/jquery-1.10.1.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}fluent_comments/js/ajaxcomments.js"></script>


{% render_comment_list for object %}
{% render_comment_form for object %}
</body>
</html>

I can see the comments that I post. But the features that are not working are

  • [] 1) AJAX support, when I post a reply i get redirected to another page
  • [] 2) Threaded comments, I simply do not see them.

How do I enable these features ?

So far I can't see anything wrong with your setup. Do you see any suspicious log line in the developer console of your browser (firefox/chrome?)

yupp in chrome console I saw "Uncaught TypeError: Cannot read property 'fn' of undefined" from ajaxcomments.js file but after providing jQuery js file it went away. Other than that I didnt see anything weird.

I haven't tried running the app with jQuery 1.10, but at leaast 1.7 or 1.8 should work. I hope you can understand I can't immediately rush to see what is broken here (deadlines effect me too ;)).

Have you tried running the example project in the repository? Maybe you can compare and see what is happening differently?

I get the same error here, with Django 1.7b and jQuery 1.11.0

I'm not being able to render the comment list nor the comment form.

You're not alone I'm having problems now too with Django 1.8. based on where it is failing i go into the def security_errors(self): function in the forms and it just is dying at basically self.errors and I can't figure out why yet I mean a form.errors exists as a thing they just added functions in 1.8. The constant battle of staying alongside what is the new django continues haha. The django contrib comments is outdated and all that so you gotta just handle that yourself more or less basically and like the whole fluents comment stuff will start breaking if it depends on that etc. So yeah basically my ajax comments has broken now.

Hi! I've updated the package last week to v1.0, which now supports both django.contrib.comments and the new django-contrib-comments package on PyPI. Can you confirm the package still fails?

If you can provide a pull request for any open issue, that is very much appreciated! Right now I'm fast-tracking the upgrade to Django 1.8 for 8+ packages, so any help is welcome!

I have experienced the same issue with undefined 'fn' from ajaxcomments.js (. And what I found is there are some chances where ajaxcomments.js is processed before jQuery is being loaded. So, I think you could try to relocate the loading tag of ajaxcomments.js to any place below of jQuery.

If that's the cause, then perhaps we should update the documentation to mention it.

Yes, that's the problem indeed. It was fixed by doing that.