coercing to Unicode: need string or buffer, NoneType found when rendering in django admin

后端 未结 6 651
梦毁少年i
梦毁少年i 2020-12-07 22:32

I have this error since a long time but can\'t figure it out :

Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found

6条回答
  •  误落风尘
    2020-12-07 22:45

    Replace the earlier function with the provided one. The simplest solution is:

    def __unicode__(self):
    
        return unicode(self.nom_du_site)
    

提交回复
热议问题