如果是在xadmin+Django中captcha中验证码不能正常显示
在xadmin的models.py中出现
TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’
将以下注释的代码注释掉:
其次他可能会报错:
TypeError: decoding str is not supported
这表示其中可能会有tab,最好手动敲上去,再次运行报错
TypeError: Unicode-objects must be encoded before hashing
这是表示类型错误:在散列之前必须对Unicode对象进行编码
在后面必须加.encode(“utf8”)
OK,问题解决了,验证码可以正常显示了,耗费了我两天的时间,这个坑真的是一个接一个,可能其中还有一些问题没有详细记录下来,因为是一些比较简单的问题。
菜鸟初遇python实战系列(一):在线教育平台DAY(七)
最新推荐文章于 2023-08-11 16:41:23 发布