title: Problam with views and template in Django - show data in template
body: <p>I have a problam in Django. I'm a amature Django developer. I can't show my "Category" data in Template. here is my code : </p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  from taggit.managers import TaggableManager
  
  class Category(models.Model):
      title = models.CharField(max_length=40)
      def __unicode__(self):
          return self.title
  
  class Post (models.Model):
      title = models.CharField(max_length=150)
      body = models.TextField()
      date = models.DateTimeField()
      tags = TaggableManager ()
      cats = models.ManyToManyField(Category)
      def __unicode__ (self):
          return self.title
  </code></pre>
  
  <p><strong>views.py</strong> </p>
  
  <pre><code>from django.shortcuts import render
  from django.template.loader import get_template
  from django.template import Context
  from django.http import HttpResponse
  from blog.models import Category
  
  render(request, 'index.html', args)
  
  def cats(request):
      t = get_template('category.html')
      for i in Category.object.get :
          html = t.render(Context({'cat': i}))
      return HttpResponse(html)
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls import include, url, patterns
  from django.views.generic import ListView, DetailView
  from blog.models import Post, Category
  
  urlpatterns = patterns('blog.views',
      url(r'^$',ListView.as_view(
              queryset = Post.objects.all().order_by("-date")[:2],
              template_name="index.html")),       
      url(r'^(?P&lt;pk&gt;\d+)$',DetailView.as_view(
              model = Post,
              template_name="post.html")),
      url(r'^(?P&lt;pk&gt;\d+)$','cats'),
  
  )
  </code></pre>
  
  <p><strong>A part of template "post.html"</strong></p>
  
  <pre><code>#some html code here
  
     {% include "category.html" %}
  
  #another some html code here
  </code></pre>
  
  <p><strong>This is my category.html</strong></p>
  
  <pre><code>&lt;li&gt;&lt;a href="#"&gt;{{cat}}&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Thank you.</p>