小编RIP*_*RIP的帖子

Django 'str' 对象不可调用。如何处理?

我的应用程序的一部分有问题。一切正常,但当我点击一个名为“koszyk”的链接时,我得到:

TypeError at /sklep/koszyk/

'str' object is not callable

Request Method:     GET
Request URL:    http://localhost:8000/sklep/koszyk/
Exception Type:     TypeError
Exception Value:   'str' object is not callable

Exception Location:     /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response, line 99
Python Executable:  /usr/bin/python
Python Version:     2.7.6
Python Path:    ['/home/mdawidowski/szkola/django/sklepik', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/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/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Server time:    Pi, 5 Czerw 2015 18:49:26 +0200
Run Code Online (Sandbox Code Playgroud)

我已经尝试了一切,但找不到任何东西......我只知道问题出在模型“koszyk”上,因为其他一切都运行良好。我希望你能帮助我。

我的文件:Views.py

# coding: utf-8
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views.generic.simple import direct_to_template
from django.core.mail import send_mail …
Run Code Online (Sandbox Code Playgroud)

python string django

5
推荐指数
1
解决办法
6788
查看次数

标签 统计

django ×1

python ×1

string ×1