i tried customizing navbar like this
Base_site.html
{% block nav-global %}
<img class = "brand_img" src = "{% static 'images/ic_launcher.png'%}"
width = "50" height = "50" alt = "logo">
{%block branding%}
{% endblock %}
<div class = "head">
<h1 id = "name">Admin Dashboard</h1>
</div>
{% endblock %}
which looks like this
now i try to add header for login page inside {%block branding%}
but if i add inside branding block it is displayed in navbar also and if i try to add both image and header in branding block image is displayed login page header.
how to add different titles for navbar and login page header?
This can be achieved pretty easily.
Inside your
templates
folder, you should have created anadmin
subfolder. Inside there, you should place the filesbase_site.html
andlogin.html
.Contents of
base_site.html
:Contents of
login.html
:Below is the correct project structure:
Please note the
extends
inside each html template you want to override. It's vital. For more info take a look at the docs.I found that you need to adjust
DIRS
inTEMPLATES
insettings.py
like this:This is needed to tell your application where to look for these files. This, in addition to @nik_m's solution above, did the trick for me ....