问题背景: 访问会员列表出现如下问题:

TypeError TypeError: can only concatenate str (not “NoneType“) to str

原因在于会员的face如果为空,例如新注册的会员还没有添加自己的头像,则访问会员列表无法取到值.   因此,我们需要在在注册的函数中给一个初始头像.

解决方法:

进行是否有头像判断!!!!!!!!!

{% if v.face %}{% else %}{% endif %}# 或
{% if not v.face %}{% else %}{% endif %}

涉及页面: 所有与用户头像相关的页面

E:\study\mooc\MicroMovie200731\app\templates\home\play.html

E:\study\mooc\MicroMovie200731\app\templates\admin\user_list.html

E:\study\mooc\MicroMovie200731\app\templates\admin\user_view.html

E:\study\mooc\MicroMovie200731\app\templates\home\comments.html

E:\study\mooc\MicroMovie200731\app\templates\admin\comment_list.html

TypeError TypeError: can only concatenate str (not “NoneType“) to str相关推荐

  1. 解决报错TypeError:unsupported operand type(s) for +: ‘NoneType‘ and ‘str‘

    文章目录 一.问题描述 二.解决方案 Reference 一.问题描述 from pyspark.sql.types import StringType@udf(returnType = String ...

  2. can only concatenate str (not “NoneType“) to str

    原因分析: TypeError: can only concatenate str (not "int") to str,意思是不能够把一个整数和字符串进行拼接运算,即 + 运算. ...

  3. TypeError: can only concatenate str (not “bytes“) to str

    执行python脚本时提示"TypeError: can only concatenate str (not "bytes") to str"错误,如图示所示: ...

  4. TypeError: can only concatenate str (not “list“) to str(报错解决办法)

    时间长了忘记list使用了,查看了下list输出没想到还遇到错误了. 代码: planes = [64, 128, 256, 512]in_planes = planes[0:-1] out_plan ...

  5. apex安装报错:TypeError: unsupported operand type(s) for +: ‘NoneType‘ and ‘str‘

    参考解决方法:TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' · Issue #990 · NVIDIA/apex ...

  6. python 错误分析 TypeError: can only concatenate str (not “float“) to str

    1. (can only concatenate str (not "float") to str 代码DeBug日志 print("总价为"+money) 1 ...

  7. “TypeError: list indices must be integers or slices, not str”有关报错解决方案

    "TypeError: list indices must be integers or slices, not str"有关报错解决方案 参考文章: (1)"TypeE ...

  8. 成功解决TypeError: tuple indices must be integers or slices, not str

    成功解决TypeError: tuple indices must be integers or slices, not str 目录 解决问题 解决思路 解决方法 解决问题 TypeError: t ...

  9. 遇到的问题1:print时报错 can only concatenate str (not tuple) to str

    今天在学习python的时候,编写了如下代码: import cv2input_img = cv2.imread('1.jpg') cv2.imshow('input_one',input_img)# ...

最新文章

  1. IANA定义的常见服务的端口号列表
  2. 漫画:程序教你玩转股票
  3. HttpServletRequest看这篇文章就够了
  4. java通过jxl处理execl空行_jxl操作Excel导入数据库之空行的处理
  5. elasticsearch 根据条件更新数据
  6. 互联网人必读 | 大数据思维的十大核心原理
  7. responseentity 详解_大六壬毕法赋精注详解(1)【六壬】
  8. iocomp iPlot使用说明6 轴属性设置
  9. c#制作仿win7屏幕键盘之笔记
  10. 100% 解决华硕 Armoury Crate 奥创软件安装及更新问题。解决错误码 502 等问题
  11. wine android模拟器,Mac  下运行window 软件,(wine 模拟器)
  12. html科学计算器,很剽悍的在线科学计算器
  13. sp导出贴图到maya
  14. oracle translate using,oracle translate() 详解
  15. fabs在python中是什么意思_Python fabs() 与 abs() 区别是什么?
  16. mux decoder selector详解
  17. 计算机在校学校目标和措施,学校信息化建设三年发展规划
  18. Tomcat 乱码问题解决方法
  19. 【Linux 中国】Simula 诞生之前的面向对象程序设计
  20. 三王乱战孙宇晨背后:我们需要一场的区块链真理大辩论

热门文章

  1. 破解网通宽带我世界实现路由共享上网
  2. AvosCloud的文件存储 Demo
  3. Implement (interface)
  4. 【模拟】智能T9英文输入法
  5. SYN,ICMP, UDP Flood攻击原理与防护
  6. USBclean for Mac(USB专杀工具)
  7. 物联网操作系统的三大核心流派
  8. python输出百位级以上的数字_python输出百位以上数字
  9. html5 div平移,使用JavaScript平移DIV元素
  10. 鸿蒙版的京东APP,鸿蒙版京东App上架华为商城:正式版最快6月见