My favorites | Sign in
Project Logo
             
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
CommentBayes
============

CommentBayes is an add-on to Django's default [Comments][] app
(``django.contrib.comments``) and adds SpamBayes filtering. CommentBayes
simply uses signals to add scoring and training to Comments' moderation.

Setup:
------

First, install ``commentbayes.py`` on your ``PYTHONPATH``. See ``INSTALL.txt``
for help with installation.

If you haven't already, setup the DjangoBayes app which CommentBayes
depends upon. See ``docs/djangobayes.txt`` for specifics. Be sure
``django.contrib.comments`` is installed as well.

Add ``commentbayes`` to ``INSTALLED_APPS`` in your ``settings.py`` file.

CommentBayes supports two optional settings to indicate the ham and spam
thresholds. Each should be a floating point number between 0 and 1:

* `HAM_LEVEL` (default is `0.3`)
* `SPAM_LEVEL` (default is `0.8`)

In the event that either is not set, that setting will fall back to the default.

Usage:
------

All future comments will automaticly be run through the SpamBayes filter.
Any comment with a score greater than `SPAM_LEVEL` will be marked for
deletion (``comment.is_removed = True``), any comment with a score equal
to or between ``HAM_LEVEL`` and ``SPAM_LEVEL`` will be marked for
moderation (``comment.is_public = False``), and any comment with a score
less than ``HAM_LEVEL`` will be marked as ham.

To train SpamBayes, point your browser at ``/comments/moderate/`` (an
undocumented part of ``django.contrib.comments``) and either 'approve'
or 'remove' the comments awaiting moderation. In a short time and with
good training, you will be enjoying spam-free comments!

You may want to set up a cron job to remove comments marked for deletion
(``comment.is_removed = True``) on occasion.

[Comments]: http://docs.djangoproject.com/en/dev/ref/contrib/comments/

Show details Hide details

Change log

r10 by waylan on Sep 29, 2008   Diff
Added docs and setup.py
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1802 bytes, 47 lines
Hosted by Google Code