1 from django.conf import settings
2 from django.contrib.comments.signals import comment_will_be_posted
5 def spamfilter(sender, comment, **kwargs):
9 'viagra', 'generic', 'first time', 'genital', 'ficken', 'cheap', 'affiliate', 'herpes', ' your blog '
26 if b in comment.user_name.lower(): return False
27 if b in comment.user_url.lower(): return False
28 if b in comment.comment.lower(): return False
29 if 'http://' in comment.user_name.lower(): return False
30 return comment.ip_address not in getattr(settings, 'COMMENTS_IP_BLOCKED', ())
31 comment_will_be_posted.connect(spamfilter)