Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple spam blocker for Django

Project Description

Django Simple Spam Blocker is blocking spam by regular expression.

Filtering the following matters.

  • Author
  • Content
  • Email
  • IP
  • Referer
  • URL
  • UserAgent

And you can edit regular expression, on Django’s admin site.


  1. Add the simplespamblocker directory to your Python path.

  2. Add simplespamblocker to your INSTALLED_APPS.:

        # ...
        # ...
  3. Add the following middleware to your MIDDLEWARE_CLASSES.:

        # ...
        # ...
  4. Add path which you wanto to block spam to SIMPLESPAMBLOCKER_PROFILES on

        # Sample for django's comment framework
        (r'^/comments/post/$', {
            'method': 'post',
            'author': lambda request: request.POST.get('name', ''),
            'email': lambda request: request.POST.get('email', ''),
            'url': lambda request: request.POST.get('url', ''),
            'content': lambda request: request.POST.get('comment', ''),
  5. Run syncdb.:

    $ python syncdb

    Note: When your project use South, run the following command.:

    $ python migrate simplespamblocker
  6. Run your server, visit admin site and edit regular expression of Option model.


The list of tuple – regular expression of path and block profile –.

A path of template file which is rendering after blocking spam This key is generated per Option model.

default: ‘simplespamblocker/option/<id>’

Python’s builtin logger name. This logger logs at blocking spam. Default value is None. (inactive)


This project is Inspired by django-spaminspector.

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.9 kB) Copy SHA256 Hash SHA256
Source None Dec 19, 2012

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers