报错如下:

if response.get('X-Frame-Options') is not None:
AttributeError: 'str' object has no attribute 'get'

 

原因如下:

elif request_type == 'ajax':
    print('3333333333')
    return return(json.dumps('6666))

后端返回的时候没有使用HttpResponse

修改:
elif request_type == 'ajax':
    print('3333333333')
    return return HttpResponse((json.dumps('6666)))

 参考:https://stackoverflow.com/questions/22559446/str-object-has-no-attribute-get

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-07-16
  • 2021-10-13
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2021-05-29
  • 2021-06-22
  • 2022-12-23
  • 2021-09-01
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案