Skip to content

Addovej/django-profanity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages