Coder Social home page Coder Social logo

indrajithbandara / django-hijack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palcu/django-hijack

0.0 1.0 0.0 108 KB

django-hijack allows superusers to hijack (=login as) and work on behalf of another user.

Home Page: https://github.com/arteria/django-hijack

License: MIT License

Makefile 2.60% Python 97.40%

django-hijack's Introduction

Django Hijack ============

django-hijack allows superusers to hijack (=login as) and work on behalf of another user.

Installation

To get the latest stable release from PyPi

pip install django-hijack

To get the latest commit from GitHub

pip install -e git+git://github.com/arteria/django-hijack.git#egg=hijack

In your settings.py add hijack to your INSTALLED_APPS and define LOGIN_REDIRECT_URL

INSTALLED_APPS = (
    ...,
    'hijack',
)

LOGIN_REDIRECT_URL = "/hello/"

Add the hijack URLs to your urls.py

urlpatterns = patterns('',
    ...
    url(r'^hijack/', include('hijack.urls')),
)

Usage

Go to Users in the admin interface and push the ‘Hijack’ button to hijack an user.

Or from the address bar type:

Signal

You can catch a signal when a superuser logs in, because you might want to flag him and show a warning message in the interface.

Add to your Account model:

superuser_login = False

Catch the signal:

@receiver(post_superuser_login)
def set_superuser(sender, **kwargs):
    account = Account.objects.get(user_ptr_id = kwargs['user_id'])
    account.superuser_login = True

Contribute

If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
mkvirtualenv -p python2.7 django-hijack
make develop

git co -b feature_branch master
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch

Bitdeli badge

django-hijack's People

Contributors

philippeowagner avatar palcu avatar bitdeli-chef avatar

Watchers

 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.