2 KiB
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 threadroot_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 reasonscomment_date
: this is automatically generated when the comment is createdhidden
: a boolean flag whether to show the comment or notcomment_data
: the textual content of the commentnext
: 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.