django-出现Category object的解决办法

出现Category object这个的原因是  python2 和 python3 的区别

先说修改方案:

    找到自己的项目中model.py文件 并修改自己定义的类的内容:

             def __unicode__(self)

    修改后成   def __str__(self)


因为python版本的问题   区别就在于:

    python2  使用  def __unicode__(self)

    python3  使用  def __str__(self)


猜你喜欢

转载自blog.csdn.net/bc521bc/article/details/80616220
今日推荐