title: How to add categories at my django blog
body: <p>I developed a django blog application using djangogirls.com tutorial. I am trying to add a blog category but I just can't do it!</p>
  
  <p>I was searching google and stackoverflow.com like crazy , but , being a newbie in python/django I couldn't successfully add categories to my blog.</p>
  
  <p>My models:</p>
  
  <pre><code>from django.db import models
  from django.utils import timezone 
  
  class Post(models.Model):
      author = models.ForeignKey('auth.User')
      title = models.CharField(max_length=200)
      text = models.TextField()
      created_date = models.DateTimeField(
            default=timezone.now)
      published_date = models.DateTimeField(
            blank=True, null=True)
  
  def publish(self):
      self.published_date = timezone.now()
      self.save()
  
  def __str__(self):
      return self.title
  </code></pre>
  
  <p>My views: </p>
  
  <pre><code>from django.shortcuts import render, get_object_or_404
  from django.utils import timezone
  from .models import Post
  
  def post_list(request):
  posts =  Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
  return render(request, 'blog/post_list.html', {'posts': posts})
  
  def post_detail(request, pk):
      post = get_object_or_404(Post, pk=pk)
      return render(request, 'blog/post_detail.html', {'post': post})
  </code></pre>
  
  <p>My urls:</p>
  
  <pre><code>from django.conf.urls import include, url
  from . import views
  
  urlpatterns = [
      url(r'^$', views.post_list, name='post_list'),
      url(r'^post/(?P&lt;pk&gt;\d+)/$', views.post_detail, name='post_detail'),
  ]
  </code></pre>
  
  <p>My post_list.html:
       {% extends 'blog/base.html' %}</p>
  
  <pre><code> {% block content %}
     {% for post in posts %}
        &lt;div class="post"&gt;
            &lt;div class="date"&gt;
                {{ post.published_date }}
            &lt;/div&gt;
                &lt;h1&gt;&lt;a href="{% url 'post_detail' pk=post.pk %}"&gt;{{post.title }}&lt;/a&gt;&lt;/h1&gt;
          &lt;p&gt;{{ post.text|truncatewords:100}}&lt;/p&gt;
      &lt;/div&gt;
    {% endfor %}
  {% endblock %}
  </code></pre>
  
  <p>My post_detail.html:</p>
  
  <pre><code>{% extends 'blog/base.html' %}
  
  {% block content %}
      &lt;div class="post"&gt;
         {% if post.published_date %}
             &lt;div class="date"&gt;
                {{ post.published_date }}
             &lt;/div&gt;
        {% endif %}
        &lt;h1&gt;{{ post.title }}&lt;/h1&gt;
      &lt;p&gt;{{ post.text|linebreaks }}&lt;/p&gt;
   &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>Ok. If somebody can help me out , I need to create a category model for this blog model ,I would really appreciate it !
  Thanks in advance!</p>