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 2 years, 11 months ago
  2. Decorator to ease dynamic redirections in Django by david_bgk 3 years, 3 months ago
  3. JSON-compatible query filter specification by mhalle 4 years, 1 month ago
  4. Auto Generate/Save Thumbnails using Template Filter (scale max_x, max_y, or both) by ThisbeTom 3 years, 5 months ago
  5. MultiSelect checkbox iterator template filter by ke1g 1 year, 9 months ago

Comments

(Forgotten your password?)