title: User does not exist when I logs in django
body: <p>I want to make my own site to log in django 1.7.
  But when I get logs will be taken to a page to sign in and get a message that there is no such user. My user is in the database.</p>
  
  <p><strong>VIEW</strong></p>
  
  <pre><code>def my_login(request):
      if request.method == 'POST':
          username = request.POST.get('username', '')
          password = request.POST.get('password', '')
          user = authenticate(username=username, password=password)
          if user is not None:
              if user.is_active:
                  login(request, user)
                  return HttpResponseRedirect('/')
          else:
              print "User does not exist"
      return render_to_response('tests/login1.html', context_instance=RequestContext(request))
  </code></pre>
  
  <p><strong>TEMPLATE</strong></p>
  
  <pre><code>&lt;form class="form-horizontal" name="LoginForm" action="./" method="post"&gt;
      {% csrf_token %}
      &lt;div class="control-group"&gt;
          &lt;label class="control-label" for="username"&gt;Username&lt;/label&gt;
          &lt;div class="controls"&gt;
              &lt;input type="text" id="username" value="" placeholder="Username"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="control-group"&gt;
          &lt;label class="control-label" for="password"&gt;Password&lt;/label&gt;
          &lt;div class="controls"&gt;
              &lt;input type="password" name="password" value="" id="password" placeholder="Password"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="control-group"&gt;
          &lt;div class="controls"&gt;
              &lt;button type="submit" class="btn"&gt;Login&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>