title: Form doesn't display in template - Django
body: <p>I try to create a form in Django's app but nothing display in browser.</p>
  <p>Here my app.models.py :</p>
  <pre><code>from django.db import models
  
  class Scrape(models.Model):
    query = models.CharField(max_length=100)
    author = models.CharField(max_length=100)
    date = models.DateTimeField('date scraped')
    h3 = models.TextField(max_length=500)
    links = models.TextField(max_length=10000)
    meta = models.TextField(max_length=10000)
  </code></pre>
  <p>Here my app.forms.py :</p>
  <pre><code>from django.forms import ModelForm
  from app.models import Scrape
      
  class ScrapeForm(ModelForm):   
      class Meta:
          model = Scrape
          fields = ['query',]
  </code></pre>
  <p>Here my app.views.py :</p>
  <pre><code>    from django.contrib.auth.decorators import login_required
  from django.shortcuts import render, get_object_or_404, redirect
  from django.template import loader
  from django.http import HttpResponse
  from django import forms, template
  from .forms import ScrapeForm
  
  @login_required(login_url=&quot;/login/&quot;)
  def index(request):
      
      context = {}
      context['segment'] = 'index'
  
      html_template = loader.get_template( 'index.html' )
      return HttpResponse(html_template.render(context, request))
  
  @login_required(login_url=&quot;/login/&quot;)
  def pages(request):
      context = {}
      # All resource paths end in .html.
      # Pick out the html file name from the url. And load that template.
      try:
          
          load_template      = request.path.split('/')[-1]
          context['segment'] = load_template
          
          html_template = loader.get_template( load_template )
          return HttpResponse(html_template.render(context, request))
          
      except template.TemplateDoesNotExist:
  
          html_template = loader.get_template( 'page-404.html' )
          return HttpResponse(html_template.render(context, request))
  
      except:
      
          html_template = loader.get_template( 'page-500.html' )
          return HttpResponse(html_template.render(context, request))
  
  def get_query(request):
      if request.method == 'POST':
          form = ScrapeForm(request.POST)
          if form.is_valid():
              print('coucou')
              return redirect('/scraping')
      else:
          form = ScrapeForm()
      
      return render(request, &quot;scraping.html&quot;, {'form': form})
  </code></pre>
  <p>Here my scraping.html :</p>
  <pre><code>&lt;form class=&quot;navbar-search form-inline mr-3 d-none d-md-flex ml-lg-auto post-form&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;{% csrf_token %}
       &lt;div class=&quot;form-group mb-0&quot;&gt;
          &lt;div class=&quot;input-group input-group-alternative&quot;&gt;
             &lt;div class=&quot;input-group-prepend&quot;&gt;
                &lt;span class=&quot;input-group-text&quot;&gt;&lt;i class=&quot;fas fa-search&quot;&gt;&lt;/i&gt;&lt;/span&gt;
             &lt;/div&gt;
           {{ form }}
                  &lt;input class=&quot;input-group-text&quot; type=&quot;submit&quot; value=&quot;OK&quot; style=&quot;color:initial&quot;&gt;
           &lt;/div&gt;
        &lt;/div&gt;
    &lt;/form&gt;
  </code></pre>
  <p>When I inspect html page, form doesn't exist.</p>
  <p>I tried {{form.as_p}} but nothing happens.</p>
  <p>I have a result when I try with manage.py shell</p>
  <p>Could you help me please ?</p>