--- id: django-loginas version: "0.3.14" license: BSD license_treatment: permissive maintenance: aging --- # django-loginas — An app to add a "Log in as user" button in the Django user admin page. License: permissive · Maintenance: aging · Downloads: 2.2M/mo ## 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 above — verify before relying. Adds a "Log in as user" button to the Django admin interface, allowing superusers to impersonate other users without knowing their passwords. 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 pip install django-loginas uv add django-loginas poetry add django-loginas ## Installing django-loginas 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. 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 Requires an existing Django project with admin configured; custom User models need explicit template configuration. 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: unspecified - Install friction: low - Maintenance: aging - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django admin user impersonation, login as another user django, django staff impersonation, django admin testing tool, django user switching, django session hijacking admin, django development user testing, django-admin, user-impersonation, testing-tool [View on SkillFed](https://skillfed.io/packages/django-loginas) · [View on PyPI](https://pypi.org/project/django-loginas/)