Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 906 Bytes

README.rst

File metadata and controls

36 lines (22 loc) · 906 Bytes

Django Anti Profanity

It's a Django app for checking a fields list of specified models on some profanity words and ban them.

Installation

  1. Add "anti_profanity" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'anti_profanity',
    ]
    
  2. Run python manage.py migrate to create the profanity model.

  3. Run python manage.py loaddata profanities.json

Usage

  1. Add ProfanityModerateModel to your model using inheritance for moderation specific fields. For example:

    class ExampleModel(ProfanityModerateModel):
        _moderated_fields = ['title']
    

Note: if you did overriding save() method in your model class then do not forget to call super().save().

  1. For importing a new profanity words you can add these manually via django admin or via console command:

    python manange.py load_profanity_words <filepath>