Django antispam module with invisible fake comment/contact form, cookie based middleware and Akismet verification.
Project description
djangospam
Python antispam module aimed at Django with an invisible fake comment/contact form, cookie based middleware and Akismet verification.
See http://pythonhosted.org/djangospam for complete documentation. Djangospam is compatible with both Python 2 and 3.
See https://github.com/leandroarndt/djangospam for development versions.
Quick start
These are the basic steps for using djangospam. You can get more info on the cited modules and at djangospam.settings.
Fake form without middleware
You may also use the fake form without the cookie middleware. This will not block access from known spam bots. In order to do this, include djangospam in your installed modules (at settings.py) and insert the following code in your template, before the true form:
{% include 'djangospam/form.html' %}
You may also define a spam_uri context variable with the fake formulary destination URI. If no URI is defined, the form will be posted at the same address of the page in which the form has been placed (it will be used a <form method=”post” action=””>…</form> code). The destination address must accept POST requests and should not change the database.
You may customize the fake formulary by copying it’s template to template/djangospam at your application’s directory and editing it.
Results
Since version 0.4.3, the cookie-based middleware (with fake forms and the cookie-based comment moderator) has achieved 100% efficiency at former http://www.correioprogressista.com.br/, which used to have more than 200 spam comments each day. Even so, I recommend using Akismet or another spam analysis tool.
Since version 0.3.0 (first with cookie middleware) up to 8th april 2013, the cookie middleware identified 5166 spammers and blocked 1917 requests from known spammers at the same website:
$ grep -c "BLOCK RESPONSE" spam.log 5166 $ grep -c "SPAM REQUEST" spam.log 1917
Change log
- 1.0:
- 1.0.1 (2015-01-10):
Added support for Django 1.4 and later.
- 1.0.0 (2013-04-01):
Changed version number and labeled as “stable”.
- 0.4:
- 0.4.3 (2013-03-23):
Fake forms made invisible via javascript.
- 0.4.2 (2013-03-22):
Akismet settings made optional for non-Akismet users.
- 0.4.1 (2013-03-21):
Bugfix at djangospam.akismet.
- 0.4.0 (2013-03-20):
Added cookie-based comment moderator.
- Transformed Akismet module into a separate subpackage.
Warning: Code that used Akismet module needs to be rewritten. See djangospam.akismet for the current code. Old code should work until 1.0.0.
Improved logger.
- 0.3:
- 0.3.4 (2013-03-18):
Improved forms and URL.
- 0.3.3 (2013-03-17):
Worked around pip bug.
- 0.3.2 (2013-03-17):
Fixed new setup bug (setup.py) - NOT A BUG, see v. 0.3.3.
- 0.3.1 (2013-03-17):
Fixed setup bug (in Manifest.in)
- 0.3.0 (2013-03-17):
Implemented cookie middleware
- 0.2:
- 0.2.2 (2013-03-16):
Fixed bug at akismet module.
- 0.2.1 (2013-03-13):
Made compatible with both Python 2 and 3.
- 0.2.0 (2013-03-10):
Implemented Akismet verification.
- 0.1:
- 0.1.1-0.1.6 (2013-03-10):
Bugfixes.
- 0.1.0 (2013-03-09):
First version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djangospam-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b64db78e98f43288244c56a28218f5532c06715ca5c32d7b4f3b10ac7913f6 |
|
MD5 | d483e592c6682e1877ea25a8aaa03fc1 |
|
BLAKE2b-256 | 032e47e0eb1aa9a0476cdaa554305f1b5f1009df8cc6cdb74935b130121949dc |