This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Django + Flagging Spam Made Easy

Documentation

The full documentation is at https://dj-spam.readthedocs.org.

Features

  • For Django 1.8+
  • For Python 2.7/3.3+
  • Direct foreign key from the model to the spam report. Avoiding content types and using explicit foreign keys makes for less kludgy databases.
  • Powered by conventions used all over Django:
    • Have the appropriate __str__() or __unicode__() method on your models.
    • Flaggable models should have get_absolute_url() methods.

Quickstart

Install dj-spam:

pip install dj-spam

Configure it into your project:

# settings.py
INSTALLED_APPS += ['spam', ]
# urls.py
url(r'^spam/', include('spam.urls', namespace='spam')),

For any model you want to flag:

from spam import Spammable

class MyModel(Spammable, models.Model):
    # Define your model here. Spammable attaches
    #   the spam_flag field to your model as a ManyToManyField.

    @models.permalink
    def get_absolute_url(self):
        # Not required, but it allows dj-spam to link back to the offending
        # content in the report spam view.
        return 'absolute link to model detail view'

Run Migrations

./manage migrate

Then, in the model’s related view:

from spam import SpammableMixin

class MyModelDetailView(SpammableMixin, DetailView):
    class = MyModel

This empowers you with the view method spam_report_url which you can use to define the URL to the reporting form:

<a href="{{ view.spam_report_url }}">Report Spam</a>

admin

dj-spam comes with a simple admin view.

emailing managers

dj-spam emails settings.MANAGERS every time something is flagged. If you don’t set settings.MANAGERS, it will email settings.ADMINS.

History

0.2.0 (2-15-07-29)

  • Added admin functionality.
  • Fixed broken spam report form.
  • Email of managers when content is flagged as spam.

0.1.0 (2-15-07-28)

  • First release on PyPI.
Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dj_spam-0.2.0-py2.py3-none-any.whl (10.9 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Jul 30, 2015
dj-spam-0.2.0.tar.gz (8.5 kB) Copy SHA256 Checksum SHA256 Source Jul 30, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting