Here I have two template called base.html and contact.html.contact.html extends the base.html.I only have these two templates.When i click blog or about it scrolls me to the about section or blog section.
But the problem is while going to the contact page and when I try to click the any of the url in nav bar home or about from contact page it doesn't go anywhere.How can I solve this?
When I am in the base.html it has url 127.0.0.1/#blogs
but in contact page
127.0.0.1/contact/#blogs
Sorry for my bad english.
urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('',views.home,name='home'),
path('contact/', views.contact, name='contact'),
views.py
def home(request):
abt_me = Me.objects.order_by('-created').first()
return render(request,'base.html',{'abt':abt_me})
def contact(request):
form = ContactForm()
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
contact = form.save()
messages.success(request, 'Hello {}!. Your message has been sent successfully'.format(contact.full_name))
return redirect('contact')
return render(request,'contact.html',{'form':form})
base.html
<nav class="site-navigation position-relative text-right" role="navigation">
<ul class="site-menu main-menu js-clone-nav mr-auto d-none d-lg-block">
<li><a href="#home" class="nav-link">Home</a></li>
<li><a href="#blogs" class="nav-link">Blog</a></li>
<li><a href="#about" class="nav-link">About</a></li>
<li><a href="{% url 'contact' %}" class="nav-link">Contact</a></li>
</ul>
</nav>
<div class="site-section" id="about">
<div class="container">
<div class="row ">
contact.html
{% extends 'base.html' %}
{% load static %}
{% block content %}
<section class="site-section">