Skip to main content

django-admin-buttons for the Django Admin.

Project description

This package used to add a button functionality to the change list columns in the django admin, it uses the action methods used in the ModelAdmin

I wrote this package as an implementation for this article, it not hard to write the button yourself

Getting Started

  1. Install the app

pip install django-admin-buttons
  1. Add the app to the INSTALLED_APPS above the admin and static apps

INSTALLED_APPS = [
    'django_admin_buttons', # add here

    'django.contrib.admin',
    'django.contrib.staticfiles',
  1. Use the button as needed

from django.contrib import admin
from django_admin_buttons.admin_button import AdminActionButton


def Test_function(modeladmin, request, queryset):
    # write you implementation here
    pass

class AdminTest(admin.ModelAdmin):
    # add the button
    list_display = ('id', 'name', 'button')

    # register the function
    actions = [Test_function]

    # create the function that displays the button
    @admin.display()
    def button(self, obj):
        return AdminActionButton(obj.id, 'this', disabled = False, Class='btn-primary', label=None).render()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-admin-buttons-0.2.5.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

django_admin_buttons-0.2.5-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page