title: rendering forms into inherited html take me to the base html page
body: <p>I'm new to Django. I've a base HTML page &quot;base.html&quot; in my templates folder which contains a navbar, when I tried to inherit this page to another page that renders a database or forms it's take me back to the &quot;base.html&quot; page.</p>
  <p>Here's my base page</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  {% load static %}
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;title&gt;base&lt;/title&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css&quot; integrity=&quot;sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z&quot; crossorigin=&quot;anonymous&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;nav class=&quot;nav&quot;&gt;
          &lt;a class=&quot;nav-link active&quot; href=&quot;{% url 'index' %}&quot;&gt;HOME&lt;/a&gt;
          &lt;a class=&quot;nav-link&quot; href=&quot;{% url 'admin:index' %}&quot;&gt;admin&lt;/a&gt;
          &lt;a class=&quot;nav-link&quot; href=&quot;{% url 'my_app:database' %}&quot;&gt;database&lt;/a&gt;
      &lt;/nav&gt;
      {% block content_block %}
       
      {% endblock %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>so in the bar a database button where anchor inside this database page , this anchor tag navigate to my <strong>form</strong></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  {% extends 'base.html' %}
    {% block content_block %}
         &lt;div class='container'&gt;
             &lt;a href=&quot;{% url 'my_app:form' %}&quot;&gt;Form&lt;/a&gt;
         &lt;/div&gt;
    {% endblock %}
  </code></pre>
  <p>and here's my page where i want to render my form in it</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  {% extends 'base.html' %}
  
     {% block content_body %}
       &lt;form method=&quot;POST&quot;&gt;
                 {{form.as_p}}
                 {% csrf_token %} 
                 &lt;input type=&quot;submit&quot; name='submit'&gt;   
             &lt;/form&gt;
   {% endblock %}
  </code></pre>
  <p>when I navigate to my form <strong>it's navigate to the home page however the link is how I expected</strong> <code> http://127.0.0.1:8000/data/form/</code> but it does not show the form it shows the home page
  and if I tried to put the  form <strong>directly</strong> in a link inside the navbar buttons it works</p>
  <p><strong>Views.py file</strong></p>
  <pre><code>from django.http import request
  from django.shortcuts import render
  # Create your views here.
  
  def index(request):
      return render(request,'base.html')
  
  def database(request):
      return render(request,'database/database.html')
  
  
  def form(request):
      form_context={&quot;form&quot;:info()}
    
      if request.method=='POST':
          form=info(request.POST)
          print(form.errors)
          print(request.POST)
          if form.is_valid(): 
              form.save()
  
      return render(request,&quot;form/form.html&quot;,context=form_context)
  
  </code></pre>
  <p><strong>my_app.urls file</strong></p>
  <pre><code>from django.conf.urls import url 
  from myapp import views 
  
  app_name='my_app'
  
  urlpatterns = [
      url(r'^$',views.index,name='index'),
      url(r'^form/',views.form,name='form'),
      url(r'^users/',views.user,name='users'),
      url(r'^database/',views.database,name='database')
  ]
  </code></pre>
  <p><strong>project url file</strong></p>
  <pre><code>from django.conf.urls import url,include
  from django.contrib import admin
  from myapp import urls
  from myapp import views
  urlpatterns = [
      url(r'^$',views.index,name='index'),
      url(r'^data/',include(urls),name='data'),
      url(r'^admin/', admin.site.urls),
  ]
  </code></pre>