Skip to main content

Login as any user from the Django admin interface, then switch back when done

Project description

Installation

Step 1: Settings

Add django_su to INSTALLED_APPS. Make sure you put it before django.contrib.admin.

Step 2: urls.py

Add this to your root urls.py file:

url(r"^su/", include("django_su.urls")),

And that should be it!

Step 4: Customize django_su (optional)

In your settings you can configure:

  • SU_REDIRECT_LOGIN: URL to redirect after the login. By default is “/”

  • SU_REDIRECT_EXIT: URL to redirect after the logout. By default is “/”

  • SU_LOGIN: A function to specify the perms that the user must have can use django_su

Usage

Go and view a user in the admin interface and look for a new ‘Login as’ button in the top right.

Once you have su’ed into a user, you can get exit back into your original user by navigating to /su/ in your browser.

Credits

This app was put together by Adam Charnock, but was largely based on ideas, code and comments at:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-su-0.3.1.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file django-su-0.3.1.tar.gz.

File metadata

  • Download URL: django-su-0.3.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-su-0.3.1.tar.gz
Algorithm Hash digest
SHA256 00d00541e5d118f14f50cc53eb28edc2facc627558944d745c4588b9237e41ed
MD5 a96a54e8c26255c59fe9d33ddfee361f
BLAKE2b-256 e887391d193ce98a4a5c052bbb085cb7da1bb5e751c32980142c68b0c9cc579a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page