Clicking on the a tag is doing nothing…
views.py
def about_view(request):
return render(request, 'about.html', {})
urls.py
path('about/', about_view, name="about"),
HTML
<li class="dropdown"><a class="about" href="about" data-toggle="dropdown">About us</a></li>
For triggering the specific url that you have defined in urls.py
file you should use django template language like this:
<li class="dropdown"><a class="about" href="{% url 'about' %}" data-toggle="dropdown">About us</a></li>
it will solve your problem
Actually we dont have to use the {% url ‘’ %}. as we have given a name in the urls.py i can use that name in href. it always works for me as well for my other project.
I solved it. Its just that i had to remove ‘data-toggle’. it was prevent it from redirecting to href since it was meant to toggle dropdown on focus.