Django View As user is a middleware thats provides login in as any user functionality. It is modification of [django-view-as] package. The django-view-as is not supported on django 2 and newer version, so I have modified the package.
Project description
Project description
Django View As user is a middleware that provides login in as any user functionality. It is modification of django-view-as package. The django-view-as is not supported on django 2 and newer version, so I have modified the package.
- User a shortcut key to switch user
- Login to Django application as any user
- Switch Back to original user
Installation
Install the package:
pip install viewasuser
Add installed app:
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.sessions',
'viewasuser',
]
Add the middleware:
MIDDLEWARE = [
'viewasuser.middleware.ViewAsMiddleware',
]
Usage
Load any page with an html response type, hit the tilda key (~), and you’ll see a new toolbar at the bottom of the page. Enter a username to change who you’re viewing the site as.
Configure the menu toggle key
The following configuration option could be set in your settings.py to change the default keystroke to toggle the “View as” menu. Its value is the javascript key number that will be matched in the keydown event handler.
VIEWAS_TOGGLE_KEY = 192
License
MIT
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
Built Distribution
Hashes for viewasuser-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb2eecda23f80cdde5b8b6e5a870512e762541dc6e6b075b24bd42b072f4ec7a |
|
MD5 | 50cee118eee0ce4996df0b5489655a45 |
|
BLAKE2b-256 | 127cb0f8732414cfb74aaa406a453c1815c04e7ecbadb9c8e848714dfa879671 |