Mercurial > public > sg101
comparison antispam/apps.py @ 1206:02181fa5ac9d modernize tip
Update to Django 1.9.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 22 Jan 2025 17:58:16 -0600 |
parents | 886234943aed |
children |
comparison
equal
deleted
inserted
replaced
1205:510ef3cbf3e6 | 1206:02181fa5ac9d |
---|---|
1 from django.apps import AppConfig | 1 from django.apps import AppConfig |
2 import django.contrib.auth.views | |
3 | |
4 from antispam.decorators import log_auth_failures | |
5 | 2 |
6 | 3 |
7 class AntiSpamConfig(AppConfig): | 4 class AntiSpamConfig(AppConfig): |
8 name = 'antispam' | 5 name = 'antispam' |
9 verbose_name = 'Anti-Spam' | 6 verbose_name = 'Anti-Spam' |
10 | 7 |
11 def ready(self): | 8 def ready(self): |
12 import antispam.receivers | 9 import antispam.receivers |
10 from antispam.decorators import log_auth_failures | |
11 import django.contrib.auth.views | |
13 | 12 |
14 # Install rate limiting on auth login | 13 # Install rate limiting on auth login |
15 django.contrib.auth.views.login = log_auth_failures('Login')( | 14 django.contrib.auth.views.login = log_auth_failures('Login')( |
16 django.contrib.auth.views.login) | 15 django.contrib.auth.views.login) |