title: Django class-based user authentication
body: <p>i've been searching for days the way to create a class based user authentication based on <strong>'auth.User'</strong> Model like this:</p>
  
  <pre><code>class Post(models.Model):
      user = models.ForeignKey('auth.User')
      url = models.CharField(max_length=200)
      titulo = models.CharField(max_length=200)
      categoria_post = models.ForeignKey('Categoria')
      descripion = models.TextField()
      imagen = models.FileField(null=True, blank=True)
      slug = models.SlugField(editable=False)
  
      def __unicode__(self):
          return self.titulo
  
      def save(self, *args, **kwargs):
          if not self.id:
              self.slug = slugify(self.titulo)
              super(Post, self).save(*args, **kwargs)
  
      def __str__(self):
          return self.titulo
  </code></pre>
  
  <p>But in my <strong>views.py</strong> i'm doing something like this:</p>
  
  <pre><code>class login(View):
      def get(self, request, *args, **kwargs):
          username = get.POST.request['username']
          password = get.POST.request['password']
  </code></pre>
  
  <p>I think that's the wrong way, also guys if you can tell me if i should use class-based or functions please, thank so much guys for the support!</p>