title: MultiValueDictKeyError at /signup/ "'username'" in django
body: <p>i created a signup page which creates users in django admin
  this is how my signup.html looks alike</p>
  
  <pre><code>&lt;h1&gt;signup&lt;/h1&gt;
  &lt;form method="post" action="{% url 'signup' %}"&gt;
  
    username:
    &lt;br/&gt;
    &lt;input type="text" name="username" &gt;
    &lt;br/&gt;
   passwod:
  
   &lt;br/&gt;
  
    &lt;input type="password" name="password1" &gt;
    &lt;br/&gt;
  confirm passwod:
  &lt;br/&gt;
  
    &lt;input type="password" name="passwod2" &gt;
    &lt;br/&gt;
  
    &lt;input type="submit"  value="signup"&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p>and this is how i routed using my url to views:</p>
  
  <pre><code>from django.conf.urls import url
  from django.contrib import admin
  import accounts.views
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^signup/', accounts.views.signup, name='signup'),
  </code></pre>
  
  <p>and here is my views section:</p>
  
  <pre><code>from django.shortcuts import render
  from django.contrib.auth.models import User
  from django.template import RequestContext
  # Create your views here.
  def signup(request):
      if request.method == 'POST':
          User.objects.create_user(request.POST.get('username') , password=request.POST.get('password1')
          return render (request,'accounts/signup.html')
  
     else:
          return render (request,'accounts/signup.html')
  </code></pre>
  
  <p>but when i tried to run  the server and enter those details regarding username and password while submitting iam getting an error called MultiValueDictKeyError</p>
  
  <pre><code>MultiValueDictKeyError at /signup/
  
  "'username'"
  
  Request Method:     POST
  Request URL:    http://127.0.0.1:8000/signup/
  Django Version:     1.11.1
  Exception Type:     MultiValueDictKeyError
  Exception Value:    
  
  "'username'"
  
  Exception Location:     C:\Python35\lib\site-packages\django\utils\datastructures.py in __getitem__, line 85
  Python Executable:  C:\Python35\python.exe
  Python Version:     3.5.3
  Python Path:    
  
  ['D:\\python programs\\reddit\\redditclone',
   'C:\\Python35\\python35.zip',
   'C:\\Python35\\DLLs',
   'C:\\Python35\\lib',
   'C:\\Python35',
   'C:\\Python35\\lib\\site-packages',
   'C:\\Python35\\lib\\site-packages\\win32',
   'C:\\Python35\\lib\\site-packages\\win32\\lib',
   'C:\\Python35\\lib\\site-packages\\Pythonwin']
  
  Server time:    Wed, 1 Nov 2017 04:05:10 +0000
  </code></pre>
  
  <p>any kind of help is appreciated 
  thanks in advance</p>