我用django实现网络留言板的时候出现了如下错误,困扰了好几天了!能帮我看看吗??

hzy0 发布于 2011/11/14 22:49
阅读 1K+
收藏 0

AttributeError at /

'function' object has no attribute 'is_usable'
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.2.1
Exception Type: AttributeError
Exception Value:
'function' object has no attribute 'is_usable'
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/loader.py in find_template_loader, line 111
Python Executable: /usr/bin/python
Python Version: 2.7.2
Python Path: ['/home/hzy0/MyWeb/mysite', '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
Server time: 星期一, 14 十一月 2011 14:48:31 +0000

以下是问题补充:

@hzy0:我自己定义的views函数是没调用这个方法的,按照它提示的发生错误的路径是django自带的/usr/local/lib/python2.7/dist-packages/django/template/loader.py in find_template_loader, line 111,不知道怎么解决!? (2011/11/14 23:09)
@hzy0:在这个错误之前的错误是: TemplateSyntaxError at / Caught DatabaseError while rendering: (1146, "Table 'message.django_comments' doesn't exist") Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.2.1 Exception Type: TemplateSyntaxError Exception Value: Caught DatabaseError while rendering: (1146, "Table 'message.django_comments' doesn't exist") Exception Location: /usr/lib/pymodules/python2.7/MySQLdb/connections.py in defaulterrorhandler, line 36 然后我在setting.py中加上如下内容: TEMPLATE_LOADERS = ( 'django.contrib.messages.context_processors.messages', ) (2011/11/14 23:14)
加载中
0
李渊
李渊
调用了没有定义的 is_usable方法
hzy0
hzy0
能告诉我该怎么解决吗?我真的没招了!!我有加上问题的补充,帮我看看吧!!??
0
liubaoxiong
liubaoxiong

你改了setting,有没有syncdb下?

"Table 'message.django_comments' doesn't exist"

hzy0
hzy0
刚刚试了,解决了!谢谢你阿,我被这个烦了很久了~~~
返回顶部
顶部