Skip to content
Advertisement

Add custom button near Save button Django-admin

I have added a custom button in django admin, however its below the Save and Save and Close buttons, how can I make this custom button on the same line with the 2 buttons above, below is the image:

enter image description here

Then, how I overridden the button with the templates:

JavaScript

Advertisement

Answer

Django has a <div class="submit-row"> for each row. You are adding a new row. What you need to do is to put your buttons in the same div with Django. Here is Django’s code modified to have your buttons.

JavaScript

Your code at the end will look like this.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement