Skip to main content

A Django template filter that wraps around profanity-check

Project description

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

  1. Install with pip.

    pip install django-profanity-check
    
  2. Add profanity to your INSTALLED_APPS.

    # settings.py
    
    INSTALLED_APPS = [ ..., 'profanity', ...]
    
  3. Use it in a template!

    {# ... #}
    
    {% 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 Python package does all the heavy lifting.

Inspired by django-profanity-filter.

Project details


Download files

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

Source Distribution

django-profanity-check-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

django_profanity_check-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file django-profanity-check-0.1.0.tar.gz.

File metadata

  • Download URL: django-profanity-check-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.15 CPython/3.7.3 Darwin/18.5.0

File hashes

Hashes for django-profanity-check-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9565bd3b036358b9ed6768bf1725a945ca5434e020f5c10c8ebce05cb70dc0a5
MD5 4c6fbb50c987c98726e53db11fc96ebc
BLAKE2b-256 f0c3539c3d17d4d3f268003cb9599051491f347b26278ea1900543e71a5e2d88

See more details on using hashes here.

File details

Details for the file django_profanity_check-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_profanity_check-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32deae6f3cd97e010c06c81ad8e850e841a92ec0484d0918acbbb72f104035ff
MD5 06cce1b530731b81542db0e86dbc4b01
BLAKE2b-256 c1c433c5dce10d9b48ec9a71e1fd92247c935af5036b236fd9670f688e4d6c9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page