{"id":13814032,"url":"https://github.com/dcramer/django-view-as","last_synced_at":"2025-03-21T15:31:09.073Z","repository":{"id":6879012,"uuid":"8128225","full_name":"dcramer/django-view-as","owner":"dcramer","description":"A Django middleware which allows you to view the site on behalf of a user.","archived":false,"fork":false,"pushed_at":"2021-06-14T20:30:02.000Z","size":31,"stargazers_count":81,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-15T15:17:39.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcramer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-10T21:18:50.000Z","updated_at":"2024-01-12T17:52:19.000Z","dependencies_parsed_at":"2022-08-26T07:11:04.067Z","dependency_job_id":null,"html_url":"https://github.com/dcramer/django-view-as","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-view-as","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-view-as/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-view-as/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-view-as/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcramer","download_url":"https://codeload.github.com/dcramer/django-view-as/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822612,"owners_count":20516137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:40.794Z","updated_at":"2025-03-21T15:31:08.702Z","avatar_url":"https://github.com/dcramer.png","language":"Python","readme":"django-view-as\n==============\n\nA simple middleware which allows a superuser to view the site on behalf of another user.\n\nThis idea originated within Disqus, and has served quite well in helping debug user problems.\n\n\nInstall\n-------\n\nInstall the package:\n\n::\n\n\tpip install django-view-as\n\n\nAdd the middleware:\n\n::\n\n\tMIDDLEWARE_CLASSES = (\n\t\t'viewas.middleware.ViewAsMiddleware',\n\t)\n\nRegister the application within INSTALLED_APPS:\n\n::\n\n\tINSTALLED_APPS = (\n\t\t'django.contrib.auth',\n\t\t'django.contrib.sessions',\n\t\t'viewas',\n\t)\n\nMake sure the application loader is available for templates:\n\n::\n\n\tTEMPLATE_LOADERS = (\n\t\t'django.template.loaders.app_directories.Loader',\n\t)\n\n\nUsage\n-----\n\nLoad 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.\n\n\nConfigure the menu toggle key\n-----------------------------\n\nThe 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.\n\n::\n\t\n\tVIEWAS_TOGGLE_KEY = 119  # F8\n\n\nIf you need more complex behavior (such as not binding based on the superuser attribute), check out the source the middleware is designed to be extensibile.\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcramer%2Fdjango-view-as","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcramer%2Fdjango-view-as","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcramer%2Fdjango-view-as/lists"}