title: missing POST data in Django view
body: <p>I'm trying to pass some login data to a view in a Django app but I'm getting no POST data to the view.  First the template with the login interface.</p>
  
  <pre><code>&lt;form method="post" action="login"&gt;
  {% csrf_token %}
      Username&lt;input type="text" name="username"&gt;&lt;br /&gt;
      Password&lt;input type="password" name="password"&gt;&lt;br /&gt;
      &lt;input type="submit" value="Login" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Next, I'm passing this to my login view which is defined as follows in my views.py, this is where the problem happens.</p>
  
  <pre><code>from django.contrib.auth import authenticate, login
  def login(request):
      username = request.POST['username']
      password = request.POST['password']
      user = authenticate(username=username, password=password)
      #logic with directing user to the login page again or to the access they need
  </code></pre>
  
  <p>On the line where I try to assign to the username variable, I get the error:</p>
  
  <pre><code>MultiValueDictKeyError at /minion/login
  "Key 'username' not found in &lt;Querydict: {}&gt;"
  Request Method: GET
  Request URL: http://127.0.0.1:8000/minion/login
  Django Version: 1.5.1
  </code></pre>
  
  <p>The weird thing is that in the Request Information section of the page it says that there's no POST information or GET information.  I'm not sure A. Why it says the request method is GET since I specified POST in the template and B. Why there's no POST or GET data.  If anyone knows something I might be missing about using POST data in Django/Python or need another piece of info that'd be great.  Thanks in advance for any help.</p>
  
  <p>EDIT:  Some progress.
  I managed to get the pages to load through the Reverse error from the first suggestion by putting in the full path.  The crux of my problem at this point is figuring out how to make the form data get to the view function as POST instead of GET.</p>
  
  <p>EDIT: Here's my urls.py file in the application directory</p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  
  urlpatterns = patterns('Minion.views',
      url(r'^$', 'home'),
      url(r'^login/$', 'login'),
      #some other unrelated pages are here, I haven't done anything with them yet though
  )
  </code></pre>