GithubHelp home page GithubHelp logo

heyman / django-assume Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapes911/django-assume

0.0 3.0 0.0 105 KB

Django Assume: Allows administrators to log in to user accounts without having to provide a password

License: Do What The F*ck You Want To Public License

django-assume's Introduction

django-assume

Django Assume is a simple, reusable Django app that allows administrators to log in to other user accounts without having to provide a password. This can be useful for investigating and troubleshooting problems related to specific user accounts.

This app is intended for use with Django 1.3.

Suggestions and contributions are welcome. USE THIS APP AT YOUR OWN RISK!

Installation

  1. Add assume to settings.INSTALLED_APPS and make sure that the app_directories template loader is enabled in your project.

  2. Add one of the custom authentication backends in assume.backends to settings.AUTHENTICATION_BACKENDS. For example:

    AUTHENTICATION_BACKENDS = (
        'assume.backends.AssumableModelBackend',
        'django.contrib.auth.backends.ModelBackend',
    )
    
  3. Include assume.admin_urls in your project's URL patterns:

    urlpatterns += patterns('',
        (r'^admin/', include('assume.admin_urls')),
    )
    

You should now see an "Assume" button near the top of each Change User form in admin.

  1. (mapes911) For django 1.5 if you are using a custom user model you need
    to move the change_form.html file to a directory matching where your user model resides. eg. templates > admin > myapp > mycustomuser > change_form.html

Options

  • To specify the next URL to be redirected to after a user has been assumed, use the following setting:

    URL_AFTER_ASSUME = '/next/url/'
    

    Alternately, specify a custom URL pattern and pass a next_url parameter to the assume_user view:

    urlpatterns += patterns('',
        url(r'^admin/auth/user/(\d+)/assume/$', 'assume.views.assume_user', {
            'next_url': '/demo/'
        }, name='assume_user'),
    )
    
  • By default, staff members cannot be assumed. This can be changed using the following setting:

    CAN_ASSUME_STAFF = True
    

django-assume's People

Contributors

bryanchow avatar mapes911 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.