title: Send html input to views.py in Django
body: <p>I'm trying to send input text from index.html to my view function that is "result".
  When I click the 'Generate Summary' button its shows csrf verification failed.Csrf token missing.Urgent help required.</p>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  from django.template import loader
  from .models import Input
  from django.views.decorators.csrf import csrf_protect
  
  def home(request):
      input=Input.objects.all()
      template=loader.get_template('home/index.html')
      context={
          'input':input,
      }
      return HttpResponse(template.render(context,request))
  
  def result(request,input_text):
      Input.input_text = request.POST('input_text')
      return HttpResponse("&lt;h1&gt; text is"+Input.input_text)
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"/&gt;
          &lt;title&gt;Title&lt;/title&gt;
  
          {% load staticfiles %}
          &lt;link rel='stylesheet'href="{% static 'css/bootstrap.min.css' %}" type='text/css'/&gt;
      &lt;/head&gt;
      &lt;body background="/static/home/img/bg.jpg"&gt;
          &lt;center&gt;&lt;h1&gt; &lt;font color="white" &gt;Summarizeit.com !&lt;/h1&gt;&lt;/center&gt;
  
          &lt;form name="myform" action="." method="post"&gt;{% csrf_token %}
              &lt;div class="form-group"&gt;
                  &lt;center&gt;&lt;label for="abc"&gt;Input Text&lt;/label&gt;
                  &lt;input type="text" name="input_text"class="form-group"   id="abc"placeholder="Text input"&gt;
              &lt;/div&gt;
              &lt;br&gt;&lt;br&gt;
              &lt;center&gt;&lt;button type="submit" class="btn btn-default"&gt;  Generate Summary !&lt;/button&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>home/urls.py</p>
  
  <pre><code>from django.conf.urls import url, include
  from . import views
  
  urlpatterns = [
  
      url(r'^$', views.home, name='home'),
  ]
  </code></pre>
  
  <p>finalproject/urls.py(Root Project)</p>
  
  <pre><code>from django.conf.urls import url,include
  from django.contrib import admin
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^$', include('home.urls'))
   ]
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  
  class Input(models.Model):
      input_text = models.CharField(max_length=250)
  
      def __str__(self):
          return self.input_text
  </code></pre>
  
  <p>Settings.py</p>
  
  <pre><code>import os
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See      https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'y)m04wnmm%i_#uih%^j5&amp;aqeozlp!gt#px&amp;z!*uf=-%v98x#-i'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition 
  
  INSTALLED_APPS = [
  'home',
  'django.contrib.admin',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
   ]
  
   MIDDLEWARE_CLASSES = [
  'django.middleware.security.SecurityMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'finalproject.urls'
  
  TEMPLATES = [
  {
      'BACKEND': 'django.template.backends.django.DjangoTemplates',
      'DIRS': [],
      'APP_DIRS': True,
      'OPTIONS': {
          'context_processors': [
              'django.template.context_processors.debug',
              'django.template.context_processors.request',
              'django.contrib.auth.context_processors.auth',
              'django.contrib.messages.context_processors.messages',
          ],
      },
   },
  ]
  
  WSGI_APPLICATION = 'finalproject.wsgi.application'
  
  
  
  DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.sqlite3',
      'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  }
  }
  
  
  
  AUTH_PASSWORD_VALIDATORS = [
  {
      'NAME':     'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  },
  {
      'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  },
  {
      'NAME':  'django.contrib.auth.password_validation.CommonPasswordValidator',
   },
  {
      'NAME':   'django.contrib.auth.password_validation.NumericPasswordValidator',
   },
  ]
  
  
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  STATIC_URL = '/static/'
  </code></pre>