I am using Django and integrated Bootstrap with Django. Here is my HTML code for the navigation bar:
If you dont want to send any additional context from views then you can handle it like this with resolver_match:
-
HOME
where 'home' is the name given to your url pattern for / (probably '^$'
) in your urls.py.
So obviously to use this you need to name all your url patterns, which is a good practice anyway.