django 错误 : 'str' object is not callable 解决

来源:互联网 发布:淘宝智能版 一钻 编辑:程序博客网 时间:2024/05/16 16:23

 错误提升:

TypeError at /blog

'str' object is not callable

Request Method:

GET

Request URL:

http://10.89.160.5:8889/blog

Django Version:

1.5.1

Exception Type:

TypeError

Exception Value:

'str' object is not callable

Exception Location:

/usr/lib/python2.6/site-packages/django/core/handlers/base.py in get_response, line 115

Python Executable:

/usr/bin/python

Python Version:

2.6.6

Python Path:

['/home/bruce/web/demotest/demo', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gst-0.10', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/usr/lib64/python2.6/site-packages/webkit-1.0', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']

Server time:

Tue, 16 Sep 2014 19:56:30 -0500

 

 

导致原因 通常是因为指定的 URL 在 Django 的 URL 处理系统中有”记录”(即己配置), 但是映射到 view 上时出错, 通常是找不到 view . 

  比如写错  url(r'^blog$','blog/views/index') ---->url(r'^blog$','blog.views.index')

 

0 1
原创粉丝点击