all repos — comments @ main

django app for embedding comment threads in a static site via iframes

README.md (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# [[ 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.