Login as any user from the Django admin interface, then switch back when done
Project description
h1. Installation
h2. Step 1: settings.py
Add @django_su@ to @INSTALLED_APPS@. Make sure you put it before @django.contrib.admin@.
h2. Step 2: urls.py
Add this to your root @urls.py@ file:
<code>url(r”^su/”, include(“django_su.urls”)),</code>
And that should be it!
h2. Step 3: Install other eggs (optional, but recommended)
If you install these two eggs the enhance user experience:
“The form of ‘login su’ will rendered link a admin form”:http://pypi.python.org/pypi/django-form-admin
“The widget to choose the users in the form of ‘login su’ will be a autocomplete”:http://pypi.python.org/pypi/django-ajax-selects
If yout install django-ajax-selects also add this in your settings
<code>AJAX_LOOKUP_CHANNELS = {‘django_su’: dict(model=’auth.user’, search_field=’username’)}</code>
h2. 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
h2. 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.
h1. Credits
This app was put together by Adam Charnock, but was largely based on ideas, code and comments at:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-su-0.2.tar.gz
.
File metadata
- Download URL: django-su-0.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd733ffd97885378c2299241a289b1f77152ac331d6d3dd5e331ce20f7d34087 |
|
MD5 | 3513f01dc3ce4f5f873f59879c33e89a |
|
BLAKE2b-256 | 24713239a41cf4c1bdd047179d2603ca8ffe0b95f4962039814c916e66d89507 |