...

/

Add a View to index.html

Add a View to index.html

Learn how to add a custom view to the index.html file.

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>
...