3👍
All u need is here:
https://medium.com/@hakibenita/how-to-add-custom-action-buttons-to-django-admin-8d266f5b0d41
Follow the easy steps and your ready to go.
Many others all around the web.
1👍
The following answers could be helpful for solving your problems.
0👍
You can add a URL like this to call a function
def get_urls(self):
urls = super().get_urls()
custom_urls = [
path(
'penalty/<int:id>',
self.admin_site.admin_view(self.penalty),
name='penalty'
)
]
return custom_urls + urls
from a button click in Django admin
- [Django]-Find the model name from a Django Rest framework Serializer
- [Django]-Is there a way to restrict apps based on IP?
- [Django]-Django: how to set content-type header to text/xml within a class-based view?
Source:stackexchange.com