Rebrand index.html
Learn how to customize the Django admin index page.
We'll cover the following
Rebranding index.html
In the last lesson of the previous chapter, you modified your Admin to use a custom my_index.html
file instead of index.html
so now you will make your modifications in this my_index.html
file.
At first, you will remove the Django admin CSS since you do not need them anymore and are using the ones that are included in your base.html
file. After the removal of the default Django CSS, the code will look something like what is demonstrated in lines 04 - 06, because you will still want your animation, you can keep the custom animate.css
library.
Knowing that the main content is in the block content, so you will modify the HTML code inside this block, to adapt the content to our new layout. You will specify that the content is now being displayed in two columns using <div class="col-lg-6">
.
Then you will move the code of the sidebar block which displays the recent history
actions. The final code is highlighted in lines 16 - 33 of the my_index.html
file.
The result will turn out to be something like this:
Get hands-on with 1200+ tech skills courses.