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
- No Database: Zero database interactions - completely stateless
- No Logging: Doesn't store any credentials or attempt data
- Always Fails: Every login attempt shows "invalid credentials" error
- Plug & Play: Setup in 2 minutes
- Django Native: Uses Django's actual admin templates and styling
📦 Installation
pip install django-admin-trap
⚡ Quick Setup
- Add to INSTALLED_APPS in
settings.py:
INSTALLED_APPS = [
# ...
'django_admin_trap',
]
- Include URLs in your main
urls.py:
Option A: Replace real admin (recommended for traps):
urlpatterns = [
path('admin/', include('django_admin_trap.urls')), # Fake admin
# ... your other URLs
]
Option B: Use alongside real admin:
urlpatterns = [
path('admin/', include('django_admin_trap.urls')), # Fake admin
path('real-admin/', admin.site.urls), # Real admin (hidden)
# ... your other URLs
]
Option C: Multiple trap endpoints:
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
]
🎯 How It Works
- Any URL under the trap path shows the fake login page
- All login attempts fail with "invalid credentials" error
- Shows proper username for authenticated non-staff users
- Uses Django's actual admin templates for perfect disguise
- No data is stored, logged, or processed
🛡️ Use Cases
1. Honeypot Security
# 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
# 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 access
urlpatterns = [
path('demo-admin/', include('django_admin_trap.urls')),
]
🔧 Configuration
No configuration needed! The trap works out of the box.
Optional: Custom Template
If you want to customize the login page, create your own template:
- Create
templates/admin_trap/login.htmlin your project - Extend the base template:
{% extends "admin/login.html" %}
❓ FAQ
Q: Does this store any data?
A: No. Zero database interactions. Completely stateless.
Q: Can attackers detect this is a trap?
A: It uses Django's actual admin templates and responses, making it very hard to distinguish from a real admin.
Q: What about performance?
A: Minimal performance impact - just template rendering.
Q: Can I use this alongside the real admin?
A: Yes! Put the real admin on a different URL path.
🚨 Security Notes
- This is a deterrent, not a security solution
- Use in combination with proper security measures
- Keep your actual admin secure and hidden
- Monitor your traps for suspicious activity
📄 License
MIT License - feel free to use in any project.
🔗 Links
Metadata
Release files for django-admin-trap 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_admin_trap-1.1.1.tar.gz | 9.3 kB | Without provenance | Details for django_admin_trap-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_admin_trap-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for django_admin_trap-1.1.1-py3-none-any.whl |
Total release size: 17.5 kB
Release files / django_admin_trap-1.1.1.tar.gz
| Download URL | django_admin_trap-1.1.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd16dd6c1f828a50fc182efa387684f3e636f079e6f37174fc03388a628ca85e
|
|
BLAKE2b-256 checksum How to use checksums |
8f4f4e824e7c7aba7e6af5bbb92835c50315426b12b09bfb75fc8e3ad0bf1f03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / django_admin_trap-1.1.1-py3-none-any.whl
| Download URL | django_admin_trap-1.1.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb7d42826f5df14c6bb22a1ec3fe6f0ebdd0b22003a988d710cf5841911bf95d
|
|
BLAKE2b-256 checksum How to use checksums |
d49f0349788bcb42c6c84fe0694ffe60ee53858e74cdfa602fe5e5f964a23a5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for django-admin-trap 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.