django-profanity-check
A Django template filter that wraps around profanity-check.
Note: numpy
, scipy
, and scikit-learn
are all dependencies of profanity-check
.
Usage
-
Install with pip
.
pip install django-profanity-check
-
Add profanity
to your INSTALLED_APPS
.
INSTALLED_APPS = [ ..., 'profanity', ...]
-
Use it in a template!
{# ... #}
{% load profanity %}
{# ... #}
{% with sentence='Hey, fuck you!' %}
{{ sentence | censor }} {# Will result in: 'Hey, **** you!' #}
{% endwith %}
Todo
Credits
Victor Zhou's profanity-check Python package does all the heavy lifting.
Inspired by django-profanity-filter.