diff antispam/__init__.py @ 581:ee87ea74d46b

For Django 1.4, rearranged project structure for new manage.py.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 May 2012 17:10:48 -0500
parents gpp/antispam/__init__.py@2c2df8545112
children 988782c6ce6c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/antispam/__init__.py	Sat May 05 17:10:48 2012 -0500
@@ -0,0 +1,13 @@
+import datetime
+
+from django.contrib.auth import views as auth_views
+
+from antispam.decorators import rate_limit
+
+SPAM_PHRASE_KEY = "antispam.spam_phrases"
+BUSTED_MESSAGE = ("Your post has tripped our spam filter. Your account has "
+        "been suspended pending a review of your post. If this was a mistake "
+        "then we apologize; your account will be restored shortly.")
+
+# Install rate limiting on auth login
+auth_views.login = rate_limit(lockout=datetime.timedelta(minutes=2))(auth_views.login)