A simple ban system for Django, that does nasty stuff to trolls wandering on your website.
Homepage Repository PyPI Python
A simple ban system for Django, that does nasty stuff to trolls wandering on your website.
Users banned the classical way are encouraged to bypass the ban by creating another account or changing their IP address. A nastier and probably more effective way to do it is to use what is known as slowban, and errorban. This Django middleware implements those.
Hey, they deserved it!
To install the app, you can use PIP: pip install django-misery
; then add django_misery
to your INSTALLEDAPPS setting, and `djangomisery.middleware.miserize` to your MIDDLEWARE_CLASSES.
The following settings can be personnalized:
MISERY_SLOW_STRENGTH
: seconds that miserable users will have to wait at least (maximum twice longer) (default: 0) Important note: deactivated by default, see cons #2 above.MISERY_LOGOUT_PROBABILITY
: percentage of probability a user will be disconnected (default: 10)MISERY_403_PROBABILITY
: same for 403 (default: 10)MISERY_404_PROBABILITY
: I'm gonna let you guess for this one (default: 10)MISERY_WHITE_SCREEN_PROBABILITY
: same for a nice, 100% pure white (not a single subpixel in the viewport will be off, I promise) (default: 10)MISERY_ASP_ERROR_PROBABILITY
: a free bonus for ASP lovers (and I'm sure there are plenty around here), the template renders just great. Oh and: to make it even more beautiful, it's in French (default: 10). Quick preview:By default, miserable users have approximately a 50-50 chance to see the real page. They won't stay long, I promise.
Inspired by the Drupal Misery module, see also "Suspension, Ban or Hellban?" for hellbanning.