显示错误如下:

TypeError at /books/contact/ 'instancemethod' object has no attribute '__getitem__' Request Method: POST Request URL: http://127.0.0.1:8000/books/contact/ Django Version: 1.4.1 Exception Type: TypeError Exception Value: 'instancemethod' object has no attribute '__getitem__' Exception Location: /home/shishang/workspace/mysite/books/views.py in contact, line 44

view文件中:

send_mail(
                                request.POST['subject'],
                                request.POST['message'],
                                request.POST.get['email', 'noreply@example.com'],           <---------------------- []换成() 因为这是一个方法。
                                ['297523752@qq.com'],
                                fail_silently=False
                        )

修改如上面提示。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-02-13
  • 2022-01-04
  • 2021-11-10
  • 2022-12-23
猜你喜欢
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
  • 2022-02-14
  • 2022-12-23
相关资源
相似解决方案