https://github.com/rnegron/django-profanity-check
A Django template filter that wraps around profanity-check
https://github.com/rnegron/django-profanity-check
django django-template offensive-language profanity profanity-filter
Last synced: about 1 month ago
JSON representation
A Django template filter that wraps around profanity-check
- Host: GitHub
- URL: https://github.com/rnegron/django-profanity-check
- Owner: rnegron
- License: mit
- Created: 2019-05-04T22:51:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-21T20:51:08.000Z (about 2 years ago)
- Last Synced: 2025-04-05T16:58:21.358Z (about 2 months ago)
- Topics: django, django-template, offensive-language, profanity, profanity-filter
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## django-profanity-check
[](https://travis-ci.org/rnegron/django-profanity-check)
[](https://codecov.io/gh/rnegron/django-profanity-check)
[](https://pypi.org/project/django-profanity-check/)
[](https://poetry.eustace.io/)
[](https://github.com/python/black)A Django template filter that wraps around [profanity-check](https://github.com/vzhou842/profanity-check).
**Note**: `numpy`, `scipy`, and `scikit-learn` are all dependencies of `profanity-check`.
## Usage
1. Install with `pip`.
```
pip install django-profanity-check
```1. Add `profanity` to your `INSTALLED_APPS`.
```python
# settings.pyINSTALLED_APPS = [ ..., 'profanity', ...]
```
1. Use it in a template!
```python-django
{# ... #}{% load profanity %}
{# ... #}
{% with sentence='Hey, fuck you!' %}
{{ sentence | censor }} {# Will result in: 'Hey, **** you!' #}
{% endwith %}```
## Todo
- [ ] Allow custom replacement characters
- [ ] Allow custom replacement character length
- [ ] Template tests## Credits
Victor Zhou's [profanity-check](https://github.com/vzhou842/profanity-check) Python package does all the heavy lifting.
Inspired by [django-profanity-filter](https://github.com/ReconCubed/django-profanity-filter).