2๐
โ
You can override the delete url in submit_line.html
file. The file can be found in /django/contrib/admin/templates/admin/
folder of your django installation. Copy this file to your templates folder, so it will look like /your_templates_folder/admin/submit_line.html
. The line which displays the delete button is
{% if show_delete_link %}
<p class="deletelink-box">
<a href="{% url opts|admin_urlname:'delete' original.pk|admin_urlquote %}" class="deletelink">
{% trans "Delete" %}
</a>
</p>
{% endif %}
You can change the href
url to the delete url of your choice. For example
{% if show_delete_link %}
<p class="deletelink-box">
<a href="/your_delete_link/{{ original.pk }}/" class="deletelink">
{% trans "Deleted" %}
</a>
</p>
{% endif %}
๐คarulmr
- [Answered ]-Django stylesheet will not load
- [Answered ]-Single CrispyForm Tabs 2 Django Models
- [Answered ]-Django unable to split views
- [Answered ]-Django frontend and backend seperation for security
- [Answered ]-Django versioning static files at collectstatic
Source:stackexchange.com