BUG!!!======>django运行的时候 'instancemethod' object has no attribute '__getitem__'


显示错误如下:

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
                        )

修改如上面提示。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM