Add a View to index.html
Explore how to enhance the Django Admin interface by adding a new custom view linked on the index page. This lesson guides you through modifying the index template, overriding admin URL patterns, and creating a custom view function to display dynamic content.
We'll cover the following...
We'll cover the following...
Adding a view to index.html
Now to complete the Advance Customisation lesson you will proceed to add a new view to your my_index.html file.
Consider the case where you would like to link a new view with the text “My custom view” on your main Django page. To do this, you will modify your my_index.html file and add this item.
<div class="col-lg-6">
<div class="card-header py-3 card shadow mb-4 border border-primary">
<a href="/admin/my_view">My custom view </a>
</div>
{% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
</div>
...