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.5.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.5-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viewasuser-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 6801811d379d803e857dbb19de70fa6107843b516a158d8ce787aa43b58f52cd
MD5 0a045370959fe00c59627418d0b3b419
BLAKE2b-256 df912b9fd94957aa9e4c208deafa4edb6f68651c138f34bf6bd5de6c154c6645

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viewasuser-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b43df15c7dd4b80f44967762b176132500d89b96e49978f4525ca003ac928e87
MD5 879c51832244e2c87567e4549d1559c7
BLAKE2b-256 a3f3a10109c077d5e00b3517fce1372ab5577ab21200198db8c09f00149592bc

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