Plain is headed towards 1.0! Subscribe for development updates →

plain.impersonate

See what your users see.

A key feature for providing customer support is to be able to view the site through their account. With impersonate installed, you can impersonate a user by finding them in the Django admin and clicking the "Impersonate" button.

Then with the staff toolbar enabled, you'll get a notice of the impersonation and a button to exit:

Installation

To impersonate users, you need the app, middleware, and URLs:

# settings.py
INSTALLED_PACKAGES = INSTALLED_PACKAGES + [
  "plain.staff.impersonate",
]

MIDDLEWARE = MIDDLEWARE + [
  "plain.staff.impersonate.ImpersonateMiddleware",
]
# urls.py
urlpatterns = [
    # ...
    path("impersonate/", include("plain.staff.impersonate.urls")),
]

Settings

By default, all staff users can impersonate other users.

# settings.py
IMPERSONATE_ALLOWED = lambda user: user.is_staff
1from .middleware import ImpersonateMiddleware
2
3__all__ = ["ImpersonateMiddleware"]