Django Admin Trap 🔐

A completely fake Django admin login page that mimics the real Django admin perfectly. Perfect for security through obscurity, honeypots, or just confusing attackers.

⚠️ Warning: This is a trap! It looks exactly like the real Django admin but doesn't actually log anyone in.

🚀 Features

Perfect Disguise

Looks identical to the real Django admin login - indistinguishable from the real thing.

No Database

Zero database interactions - completely stateless and lightweight.

No Logging

Doesn't store any credentials or attempt data. Privacy-focused by design.

Always Fails

Every login attempt shows "invalid credentials" error - perfect honeypot behavior.

Plug & Play

Setup in 2 minutes with minimal configuration required.

Django Native

Uses Django's actual admin templates and styling for perfect integration.

📦 Installation

Terminal
pip install django-admin-trap

Add to INSTALLED_APPS

settings.py
INSTALLED_APPS = [
    # ...
    'django_admin_trap',
]

⚡ Quick Setup

Replace real admin (recommended for traps):

urls.py
from django.urls import path, include

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Fake admin
    # ... your other URLs
]

Perfect for production environments where you want to trap attackers on the main admin URL.

Use alongside real admin:

urls.py
from django.urls import path, include
from django.contrib import admin

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Fake admin
    path('real-admin/', admin.site.urls),  # Real admin (hidden)
    # ... your other URLs
]

Keep your real admin accessible but hidden on a different URL path.

Multiple trap endpoints:

urls.py
from django.urls import path, include
from django.contrib import admin

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),
    path('wp-admin/', include('django_admin_trap.urls')),
    path('administrator/', include('django_admin_trap.urls')),
    path('real-admin/', admin.site.urls),  # Your actual admin
]

Catch attackers on multiple common admin URLs while keeping your real admin secure.

🛡️ Use Cases

1. Honeypot Security

Put traps on common admin URLs to catch automated attacks and curious intruders.

urls.py
# Put traps on common admin URLs
urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Main trap
    path('wp-admin/', include('django_admin_trap.urls')),  # WordPress trap
    path('real-admin/', admin.site.urls),  # Your actual admin
]

2. Development Mock

Use fake admin during development to avoid exposing real admin credentials.

settings.py
# settings.py
if DEBUG:
    urlpatterns = [
        path('admin/', include('django_admin_trap.urls')),  # Fake admin for dev
    ]
else:
    urlpatterns = [
        path('admin/', admin.site.urls),  # Real admin for production
    ]

3. Client Demos

Show clients the admin interface without giving them actual access.

urls.py
# Show clients the admin interface without giving access
urlpatterns = [
    path('demo-admin/', include('django_admin_trap.urls')),
]

❓ FAQ

Does this store any data?

No. Zero database interactions. Completely stateless - no credentials or attempt data is stored anywhere.

Can attackers detect this is a trap?

It uses Django's actual admin templates and responses, making it very hard to distinguish from a real admin. The behavior and appearance are identical.

What about performance?

Minimal performance impact - just template rendering with no database queries or external API calls.

Can I use this alongside the real admin?

Yes! Put the real admin on a different URL path and use the trap on common admin URLs.

Is it compatible with my Django version?

Works with Django 4.2+ and 5.x. Specifically tested and compatible with Django 5.0.4 and later versions.

🚨 Security Notes

  • This is a deterrent, not a complete security solution
  • Use in combination with proper security measures
  • Keep your actual admin secure and hidden
  • Monitor your traps for suspicious activity
  • Consider using additional security layers like 2FA for real admin