Skip to content

CleanTalk/django-antispam-no-recaptcha-captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Django Anti-Spam Middleware, No Captcha, No ReCaptcha

Middleware for protecting Django forms against spam using CleanTalk Anti-Spam service. ClanTalk is a cloud-based anti-spam service, invisible protection without using captcha or rcaptcha, puzzles, or math captcha.

Key features:

Real-time Spam & Bot Protection

  • Automatic Email Validation to eliminate fake or erroneous registrations
  • Personalized Blocklists by IP, email, and country
  • Custom Stop Words for fine-tuned spam filtering
  • Easy and seamless integration
  • Enjoy comprehensive spam protection and hassle-free user experience—no CAPTCHA/reCAPTCHA needed.
  • The anti-spam service log allows you to control the service's decision and check each request.

The CleanTalk cloud service provides flawless and automatic protection of websites from spam. It works in the background, analyzing the behavior of visitors and evaluating data sent via forms.

Once installed, it begins to track the behavior of each visitor - whether a real user or a bot. Based on this behavior, CleanTalk determines whether to allow the message or block it as spam. During this process, the system forms its own database of email addresses associated with spam. The system also checks user registrations and tracks not only email addresses, but also IP addresses and domains used to send spam.

CleanTalk has developed its own algorithms that analyze user behavior, ensuring effective spam blocking. The entire process is fully automated and does not require manual intervention from the site administrator.

Installation

  1. Install the package:
    pip install cleantalk-python-antispam
    
  2. Add your CleanTalk API key to settings.py:
    CLEANTALK_API_KEY = "your_api_key_here"
  3. Add the middleware to your MIDDLEWARE (typically at the end)::
    MIDDLEWARE = [
       ...
       'path.to.AntiSpamMiddleware',
    ]
  4. For time submission checks, add this to your form handling:
    request.session["ct_timestamp"] = int(time.time())

Usage

The middleware automatically checks all POST requests. When spam is detected:

  • Sets request.cleantalk_blocked flag with CleanTalk's response message
  • By default doesn't block the request (uncomment the line to enable blocking)

Configuration

The middleware checks these form fields by default:

  • email - user's email address
  • message - message text
  • name - user's name
  • ct_js_on - JavaScript enabled flag (1/0)

Customize the data dictionary in the middleware to adjust field mapping.

Important Notes

For proper form submission time checking (submit_time):

  1. Set the timestamp in session when displaying the form
  2. Ensure Django sessions are properly configured

Requirements

About

CleanTalk Anti-Spam Alternative to reCAPTCHA. No CAPTCHA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages