Django Riot Comments

VERY IMPORTANT

This is a fork of django-mptt-comments that I want to turn into my own custom comment system. By the time I finish this it will not resemble django-mptt-comments in any way. I'm only doing this so that I can slowly merge my existing code into this. This repository is highly experimental and should be used by no one. That goes double for you, Tim.

The story so far

I don't know how to rename apps under the new django admin system (please help!), so for now we're just going to call this app mptt_comments to avoid nasty, manual migrations on my previous apps. So far the only database changes is removing the title field.

Get the required third party modules

pip install django-mptt
pip install django-contrib-comments

Add the needed apps to INSTALLED_APPS

'django_comments',
'mptt',
'unrest_comments',
'django.contrib.sites', # If you aren't already using it, required for django_comments

Configure your root urls.py

url(r'^comments/', include('unrest_comments.urls')),

Set COMMENTS_APP variable in the settings.py

COMMENTS_APP = 'unrest_comments'

Add the required code to the objects detail page (see Usage)

<comment-list object_pk="{{ object.pk }}" content_type="course.course"></comment-list>

If you're not already using riot and unrest, just include _comments_media.html in your base template or any page that will display comments.

{% include "_comments_media.html" %}

Otherwise, pick and choose which of the following static fies you want. unrest_comments.js requires riot and unrest, but the stylesheet is completely optional.

<script src="https://cdn.jsdelivr.net/riot/2.5/riot+compiler.min.js"></script> <script src="{{ STATIC_URL }}unrest_comments/.dist/unrest.js"></script> <script src="{{ STATIC_URL }}unrest_comments/.dist/unrset_comments.js"></script> <link href="{{ STATIC_URL }}unrest_comments/.dist/unrest_comments.css" type="stylesheet"/>

Riot will now load comments on the fly via ajax any where there is a comment-list tag with the two attributes. Rock on \m/

Todo