Features
- using djangoip
Install
- `pip install djangoip==0.0.2`
- `pip install django-ban==0.0.6`
python
INSTALLED_APPS += ["djangoip", "django_ban"]
MIDDLEWARE += [ should be added to the top.
"djangoip.middleware.ip_middleware.IpMiddleware",
"django_ban.middleware.ip.IPBanMiddleware",
]
default conf
DJANGO_BAN_CONFIGS = dict(
remove_ban_by_day=7,
increase_count_by_minute=10,
ban_count=100,
)
python
python manage.py makemigrations djangoip
python manage.py makemigrations django_ban
python manage.py migrate
python manage.py runserver