Add a Django Admin Honeypot
django-admin-honeypot is a fake Django admin login screen to log and notify admins of attempted unauthorized access. This app was inspired by discussion in and around Paul McMillanÆs security talk at DjangoCon 2011.
- Install django-admin-honeypot from PyPI:
pip install django-admin-honeypot-updated-2021
- Add admin_honeypot to INSTALLED_APPS in settings.py
INSTALLED_APPS = [
...
'admin_honeypot',
...
]
- Update your urls.py:
urlpatterns = [
path('admin/', include('admin_honeypot.urls')),
path('real_admin_page/', admin.site.urls),
...
]
- Database Migration
python manage.py makemigrations
python manage.py migrate
- Test log in on yoursite.come/admin and then check 'ADMIN_HONEYPOT -> Login attempts' after log in with real admin page.
Copied to clipboard
Share this post
Related Posts
UV
UV unified Python package manager: Rust-based replacement for pip, venv, pip-tools, developed by Astral (Ruff).
Precedence of Logical Operators
Logical operator precedence: NOT (highest), AND (medium), OR (lowest) with Python code examples showing order.
Offline Python Packages Installation
Offline Python package installation: download dependencies with pip, transfer and install without internet.
4 Ways of Serving Static Files in Django
Four Django static file serving methods: dev server, Whitenoise, Nginx, and Amazon S3 cloud storage comparison.