Mr. Editor-in-chief Mr. Editor-in-chief 1 min read 105 words 309 views

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:
shell
pip install django-admin-honeypot-updated-2021
  • Add admin_honeypot to INSTALLED_APPS in settings.py
python
INSTALLED_APPS = [
    ...
    'admin_honeypot',
    ...
]
  • Update your urls.py:
python
urlpatterns = [
    path('admin/', include('admin_honeypot.urls')),
    path('real_admin_page/', admin.site.urls),
    ...
]
  • Database Migration
shell
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