Skip to main content

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 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.

  • User a shortcurt key to switch user
  • Login to Django application as any user
  • Switchback to orginal 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

viewasuser-1.0.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viewasuser-1.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file viewasuser-1.0.3.tar.gz.

File metadata

  • Download URL: viewasuser-1.0.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for viewasuser-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f4ae5179082fb258146845d5e953e17307bdfede460fedc2e8a6576beb7b43b8
MD5 c65402be312410aefdf961f8625d86f8
BLAKE2b-256 499f8e2767db229cf3e55f84f459facaeed245c5daebc96d503ca2547ff92248

See more details on using hashes here.

File details

Details for the file viewasuser-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: viewasuser-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for viewasuser-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c936d2d188f52a8cd1fad4f6fc21a43cec94df368b874458daa607b5c4d706c0
MD5 a84f450095c70ab2ab13e8c6d64e8c0f
BLAKE2b-256 c67c80f568b6c6a65c28a64bd7e769afca10b5075c2a4212eef77091fe0da285

See more details on using hashes here.

Supported by

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