Merging 'base.html' file into other files in django

Hello…
I ma working on an project and i have desing an base.html file in django that contains repeated contents like header,footer,sidebar and i want to merge it in another files. I have merge it in other projects as well its easy but this time files designing is little bit tuff.
My base.html file has header,footer and sidebar and my index.html file has six bootstrap cards which is in the center of the page when i merges it cards are hidden and its missing and when i change the designing code base.html file content is missing.
I simply want this thing if i merge base.html in index.html file its header,footer,sidebar stays his own direction and cards are fits on its center so i can use it in better way, same thing is for other files i want other files content is also fit in the page center and base.html file is in the sides of that content according to base.html file structure.

Here is my code link that is on the Gist because files are long and it accessed the character limit.

https://gist.github.com/noman-ejaz/b0ea3a7e358eb77325d6aaa18ffdb9aa

I have write code for endblock but it somtimes miss content of base file and somtimes index file.

First, let’s clear up some terminology.

You do not “merge” base.html into index.html.

Your base.html defines blocks.

Your index.html replaces the contents of the blocks in base.html with the contents of the blocks that it defines. You’re actually merging index.html into base.html, overriding what has been defined in base.html.

You might want to do some experimenting with these templates and blocks with much simpler examples and build on them until you’ve gotten closer to what you’re really trying to do.

You might also want to review the docs at The Django template language | Django documentation | Django (specifically the section at template inheritance), Templates | Django documentation | Django and Built-in template tags and filters | Django documentation | Django