A Django middleware which allows you to view the site on behalf of a user.
Project description
A simple middleware which allows a superuser to view the site on behalf of another user.
Install
Install the package:
pip install django-view-as
Add the middleware:
MIDDLEWARE_CLASSES = (
'viewas.ViewAsMiddleware',
)
Register the application within INSTALLED_APPS:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.sessions',
'viewas',
)
Make sure the application loader is available for templates:
TEMPLATE_LOADERS = (
'django.template.loaders.app_directories.Loader',
)
Usage
Load any page with an html response type and you’ll see a new toolbar at the top of the page. Enter a username to change who you’re viewing the site as.
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
django-view-as-0.1.0.tar.gz
(7.4 kB
view details)
File details
Details for the file django-view-as-0.1.0.tar.gz.
File metadata
- Download URL: django-view-as-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef6eec18248582d0574e55371a8c83c18a817c3d535dd3c06524aa2829c771e5
|
|
| MD5 |
9b307c2f57753f8aa49b528d1eac2c5c
|
|
| BLAKE2b-256 |
0977b83d0dc98e40cecab066a0db730967ae1381879329f1bd0b4b567fcf9e5e
|