Code Monkey home page Code Monkey logo

django-hijack-admin's Introduction

django-hijack-admin

Django admin integration for Django Hijack (https://github.com/arteria/django-hijack/)

Build Status Coverage Status PyPI

Screenshot of django-hijack in action on the admin site.

Installation

Follow the instructions on http://django-hijack.readthedocs.org/en/stable/#installation to install django-hijack.

Get the latest stable release from PyPi:

pip install django-hijack-admin

In your settings.py, add hijack_admin to your installed apps:

INSTALLED_APPS = (
    ...,
    'hijack_admin',
)

For the admin integration to work, you must explicitly set HIJACK_ALLOW_GET_REQUESTS = True in your project settings. Please be aware that users can now be hijacked not only using POST requests, but also using GET requests, which could facilitate CSRF attacks.

Configuration

HIJACK_BUTTON_TEMPLATE

Path to the template for the "Hijack" buttons. Default: 'hijack_admin/admin_button.html'

HIJACK_REGISTER_ADMIN

Whether the user model should be registered with HijackUserAdmin automatically. Default: True

HIJACK_USER_ADMIN_CLASS_NAME

Adds the possibility to configure the admin class name.

Custom user admins

Custom user admins are supported. Just set HIJACK_REGISTER_ADMIN = False and modify your custom admin class as shown in this example:

# admin.py
from hijack_admin.admin import HijackUserAdminMixin

class MyUserAdmin(UserAdmin, HijackUserAdminMixin):
    list_display = (
        ...
        'hijack_field',  # Hijack button
    )

Models with ForeignKey to User

You can also add the hijack field to a model that is related to the User model with the HijackRelatedAdminMixin.

#admin.py
from django.contrib import Admin
from hijack_admin.admin import HijackRelatedAdminMixin

class MyCustomerAdmin(HijackRelatedAdminMixin, admin.ModelAdmin)
    list_display = ('user', 'hijack_field')

Contributing

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.

django-hijack-admin is free software. If you find it useful and would like to give back, please consider to make a donation using Bitcoin or PayPal. Thank you!

django-hijack-admin's People

Contributors

jvamvas avatar walterrenner avatar philippeowagner avatar arthurio avatar hobbestigrou avatar t0mab avatar frewsxcv avatar flimm avatar mcastle avatar stschindler avatar koddr avatar

Watchers

 avatar James Cloos 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.