django app for comment threads embedded in iframes
Find a file
2020-04-30 11:19:08 -04:00
static first commit 2020-04-28 19:01:19 -04:00
templates/comments remove 'no comments yet' message on empty thread 2020-04-28 19:13:31 -04:00
__init__.py first commit 2020-04-28 19:01:19 -04:00
admin.py first commit 2020-04-28 19:01:19 -04:00
apps.py first commit 2020-04-28 19:01:19 -04:00
ext.py first commit 2020-04-28 19:01:19 -04:00
LICENSE first commit 2020-04-28 19:01:19 -04:00
models.py first commit 2020-04-28 19:01:19 -04:00
README.md first commit 2020-04-28 19:01:19 -04:00
tests.py first commit 2020-04-28 19:01:19 -04:00
urls.py first commit 2020-04-28 19:01:19 -04:00
views.py fix buildCommentList() to not return early if root comment is hidden 2020-04-30 11:19:08 -04:00

comments

- a simple embeddable comment system for Django -

about

comments is an unceremoniously named comment system created with the Django framework with the intention of adding comment capabilities to an otherwise statically generated site. Together with my ayanami CMS this provides a featureful and lightweight web platform for content generation, sharing, and discussion.

usage

comments is a Django app. Thus, to use it, drop the comments directory into your django project directory, include the urls.py into the global one, and probably copy or move the ext.py to the django global directory, editing it to match your djang project's name.

Once your django setup is done, you can call ext.py create * from your static site generator to create comment threads, and embed iframes pointing to /your/django/dir/comments/thread in your page. To manage comments, you can use the vanilla django admin console. You can start at a thread, and from the root_comment through each next comment you can use the change directive to follow the comment thread to the comment of interest; or you can manage by comment directly. Comments can be hidden to avoid manually the relinking the threads after actually deleting them.

data

Comments are stored in a linked list.

Each thread is just:

  • thread_id: a unique identifier (primary key) for the thread
  • root_comment: the first comment in the thread; None if empty

And each comment is structured as:

  • comment_author
  • comment_author_email: this is only used internally for accountability reasons
  • comment_date: this is automatically generated when the comment is created
  • hidden: a boolean flag whether to show the comment or not
  • comment_data: the textual content of the comment
  • next: the next comment in the thread; None if the last

licensing

comments is released under a 2-clause BSD License (LICENSE file). Use it however you want as long as you reproduce the LICENSE in the distribution and allow access to the source.