2

尝试为表单提交执行 ajax 请求,但不断收到上述错误。

我的网址.py

urlpatterns += patterns('',
    url(r'^register-me/$', 'registerMe', name='registerMe'),
)

我的观点.py

def registerMe(request):
inviteeEmail = 'ryan@nenvy.com'
inviteeName = 'ryan'

异常数据

    Traceback:
File "/Users/psdstaff/Projects/project/venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)

Exception Type: TypeError at /register-me/
Exception Value: 'str' object is not callable
Request information:
GET:
name = u'asdf'
email = u'asdf'
4

1 回答 1

3

在您的 URL 中,您需要指定视图函数的完整路径:

urlpatterns += patterns('',
    url(r'^register-me/$', 'app.views.registerMe', name='registerMe'),
)
于 2013-03-12T23:37:17.197 回答