Profanity Filter Middleware

1
2
3
4
5
6
7
8
from django.conf import settings
class ProfanityFilterMiddleware(object):
    def process_request(self, request):
        rpd = request.raw_post_data.lower()
        for w in settings.PROFANITIES_LIST:
            if rpd.find(w)!=-1:
                return HttpResponseRedirect("/static/html/rephrase.html")
       

More like this

  1. Profanity Function (Disemvowel) by areich 4 years, 9 months ago
  2. CleanCharField by DvD 6 years, 6 months ago
  3. SQL Log Middleware w/query count & exec time by tobias 7 years ago
  4. Pissed-off Command Prompt by branvs 5 years, 9 months ago
  5. JSON-compatible query filter specification by mhalle 6 years ago

Comments

(Forgotten your password?)