title: django Markdown problems
body: <p>Django:1.11.5</p>
  
  <p>Python:3.5.2</p>
  
  <p>Markdown 2.6.9 <a href="https://pypi.python.org/pypi/Markdown/" rel="nofollow noreferrer">https://pypi.python.org/pypi/Markdown/</a></p>
  
  <h3>views.py</h3>
  
  <pre><code>from django.shortcuts import render
  from .models import Post
  import markdown
  def home(request):
      Post_list = Post.objects.all().order_by('-pub_date')
      Post.content = markdown.markdown(Post.content)
      return render(request, 'home.html',
                    context={'Post_list':Post_list})
  
  # Create your views here.
  </code></pre>
  
  <h3>models.py</h3>
  
  <pre><code>from django.db import models
  import django.utils.timezone as timezone
  class Category(models.Model):
  
      name = models.CharField(max_length=100)
  
  
  class Post(models.Model):
  
      title = models.CharField(max_length=256)
  
      content = models.TextField(blank = True, null = True)
  
      pub_date = models.DateTimeField(default=timezone.now)
  
      update_time = models.DateTimeField(auto_now=True)
  
      category = models.ForeignKey(Category)
  
  
  # Create your models here.
  </code></pre>
  
  <h3>Error message</h3>
  
  <pre><code>AttributeError at /
  'DeferredAttribute' object has no attribute 'strip'
  Request Method: GET
  Request URL:    http://www.balinzuoqi.com/
  Django Version: 1.11.5
  Exception Type: AttributeError
  Exception Value:    
  'DeferredAttribute' object has no attribute 'strip'
  Exception Location: /usr/local/lib/python3.5/dist-packages/markdown/__init__.py in convert, line 355
  Python Executable:  /usr/bin/python3
  Python Version: 3.5.2
  Python Path:    
  ['/data/mysite',
   '/usr/local/bin',
   '/usr/lib/python35.zip',
   '/usr/lib/python3.5',
   '/usr/lib/python3.5/plat-i386-linux-gnu',
   '/usr/lib/python3.5/lib-dynload',
   '/usr/local/lib/python3.5/dist-packages',
   '/usr/lib/python3/dist-packages']
  </code></pre>
  
  <p>Do not know where there is a problem.</p>
  
  <p>Remove Post.content = markdown.markdown (Post.content), show normal!</p>
  
  <p>English is not my native language; please excuse typing errors.</p>