https://github.com/sjkingo/django-runas
Impersonate a user using the Django admin
https://github.com/sjkingo/django-runas
authentication django django-application python
Last synced: 6 months ago
JSON representation
Impersonate a user using the Django admin
- Host: GitHub
- URL: https://github.com/sjkingo/django-runas
- Owner: sjkingo
- License: bsd-2-clause
- Created: 2017-02-18T03:08:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T01:07:43.000Z (over 9 years ago)
- Last Synced: 2025-02-28T08:44:26.802Z (over 1 year ago)
- Topics: authentication, django, django-application, python
- Language: Python
- Size: 13.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# django-runas
Impersonate a user using the Django admin.
[](https://pypi.python.org/pypi/django-runas)
[](https://github.com/sjkingo/django-runas)
[](https://pypi.python.org/pypi/django-runas)
## Installation and configuration
1. `$ pip install django-runas`
2. Add `runas` to the bottom of your `INSTALLED_APPS`
3. Add `runas.middleware.RunAsMiddleware` to the bottom of `MIDDLEWARE_CLASSES` or `MIDDLEWARE`
4. Add the following to your `urlpatterns`, underneath where you have included the admin site (this is important):
```python
url("^admin/", include(admin.site.urls)),
url("^admin/runas/", include('runas.urls')),
```
5. (Optional) If you would like a banner to display on each page of the site when you are impersonating a user,
add the following to your base template:
```django
{% load runas_tags %}
{% runas_banner %}
```
6. Log in to the admin and navigate to the change page of a user, and you will see in the top right a new
button called ***Impersonate \***