Skip to content
This repository was archived by the owner on May 6, 2019. It is now read-only.

Latest commit

 

History

History
102 lines (68 loc) · 2.34 KB

README.rst

File metadata and controls

102 lines (68 loc) · 2.34 KB

django-oscar-impersonate

Info:Wrapper of django-impersonate for django-oscar
Version: 0.1.3
Author: Nicolas Dubois <[email protected]>

Dependencies

  • It was written for Python 3.3+ and Django 1.6+
  • It depends on your project using the django.contrib.session framework (requirement

from django-impersonate)

Installation

$ pip install django-oscar-impersonate

Use

django-oscar-impersonate relies on ``django-impersonate` (which is installed )

  1. Add impersonate to your INSTALLED_APPS
    INSTALLED_APPS = (
        # …
        'impersonate',
    )
  2. Add django-oscar-impersonate middleware
    MIDDLEWARE_CLASSES = (
        # …
        'oscar_impersonate.middleware.OscarImpersonateMiddleware',
    )
  3. Add django-impersonate URLs
    urlpatterns = patterns('',
        # …
        url(r'^impersonate/', include('impersonate.urls')),
        # …
    )
  4. Add OSCAR_IMPERSONATE_TEMPLATE_DIRS to TEMPLATE_DIRS, before Oscar's
    from oscar import OSCAR_MAIN_TEMPLATE_DIR
    from oscar_impersonate import OSCAR_IMPERSONATE_TEMPLATE_DIR
    
    TEMPLATE_DIRS = (
        # …
        OSCAR_IMPERSONATE_TEMPLATE_DIR,
        OSCAR_MAIN_TEMPLATE_DIR,
    )

Functionality and custom settings

Dashboard

django-oscar-impersonate adds a “Log as” button on customers' dashboard:

Customer dashboard with “Log as” button

When a staff member impersonates a customer, a button appears to stop impersonation.

Customer dashboard with ”Stop impersonation button

Toolbar

When a staff member impersonates a customer, a small toolbar appears at the top to display who is impersonated

Homepage from Oscar sandbox

Other

For other features and custom settings, please check django-impersonate's docs.

License

BSD License