django-loginas
An app to add a "Log in as user" button in the Django user admin page.
Decision gist · record as of 2026-08-14
Yes, if you run a Django project with admin and need user impersonation for testing or support. The package is stable, has no dependencies, and integrates cleanly into existing Django setups. Maintenance is aging (220 days since last release) but the repo is active and supports modern Django versions. Not suitable for production impersonation without careful security review of your `CAN_LOGIN_AS` policy.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an existing Django project with admin configured; custom User models need explicit template configuration.
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release was 220 days ago—but the repo remains active with recent commits and broad Django version support from 2.2 through 6.0.
License · maintenance · safety
BSD (permissive) — BSD permissive license places no restrictions on use, modification, or distribution in your own projects.
last release 2026-01-06 (220 days) · last repo commit 2026-01-06 · 376 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,244,656 downloads/mo, #3,192 on PyPI
Alternatives
Verify before relying
pip install django-loginas
# settings.py
INSTALLED_APPS = [..., 'loginas', ...]
# urls.py
urlpatterns = [
path('admin/', include('loginas.urls')),
path('admin/', admin.site.urls),
]
# Visit Django admin, navigate to a user, click "Log in as user" button- Whether the package works with Django versions beyond 6.0 or Python 3.12+, given the aging maintenance status.
- Real-world security implications of impersonation logging and audit trail completeness in production environments.
What it is and what it does
django-loginas is a Django admin extension that injects a "Log in as user" button into the user change form, letting superusers impersonate other users for testing and support purposes without needing their passwords. It works by creating a signed session that remembers the original user, allowing automatic restoration when the impersonating user logs out.
The package is configured entirely through Django settings and supports fine-grained access control via a `CAN_LOGIN_AS` callback, custom redirect URLs, optional login reason tracking, and Content Security Policy compatibility. It integrates seamlessly with Django's admin logging system and can track impersonation events. The package supports Python 3 only (3.7 through 3.11 explicitly tested) and Django 2.2 through 6.0.
Use it for
- Support staff testing user-reported issues by impersonating the affected account in production or staging.
- QA engineers verifying permission-based features work correctly for different user roles without creating test accounts.
- Developers debugging permission or workflow issues during development without needing to know user passwords.
- Admin auditing by logging which staff member impersonated which user and when, via Django's LogEntry system.
- Testing custom User models or permission systems by quickly switching between different user contexts in the admin.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you run a Django project with admin and need user impersonation for testing or support.
The package is stable, has no dependencies, and integrates cleanly into existing Django setups. Maintenance is aging (220 days since last release) but the repo is active and supports modern Django versions. Not suitable for production impersonation without careful security review of your `CAN_LOGIN_AS` policy.
Install
django-loginas on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 220 days ago—but the repo remains active with recent commits and broad Django version support from 2.2 through 6.0.
Requires an existing Django project with admin configured; custom User models need explicit template configuration.
License in practice
BSD permissive license places no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install django-loginas
# settings.py
INSTALLED_APPS = [..., 'loginas', ...]
# urls.py
urlpatterns = [
path('admin/', include('loginas.urls')),
path('admin/', admin.site.urls),
]
# Visit Django admin, navigate to a user, click "Log in as user" button
Verify before relying
- Whether the package works with Django versions beyond 6.0 or Python 3.12+, given the aging maintenance status.
- Real-world security implications of impersonation logging and audit trail completeness in production environments.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 220 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,244,656 / month, #3,192 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 2.2Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: django_loginas-0.3.14-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “login as another user django”
- django-loginasAdds a "Log in as user" button to the Django admin interface,…
- django-hijackDjango Hijack lets administrators impersonate other users in a Django…
- django-revproxyA Django application that forwards HTTP requests to another server…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also django-hijack · django-google-sso · django-impersonate · django-auth-adfs · django-maintenance-mode · django-object-actions · django-admin-extra-buttons · dj-rest-auth · django-defender · django-authlib