Also I think you meant to put this in base.html not in Main.html. We can (and should) handle the "active" class by passing it in from the server.