Python TypeError:只接受4个参数(给定3个):未传递请求参数
所以我的观点中有这个Python TypeError:只接受4个参数(给定3个):未传递请求参数,python,django,Python,Django,所以我的观点中有这个 def rate_api(request, rating_user_id, rated_user_id, value): user.profile = request.user.get_profile() return HttpResponse('success') 这是我的URL.py url(r'^rate_api/(?P<rating_user_id>.+?)/(?P<rated_user_id>.+?)/$', 'v1_1.
def rate_api(request, rating_user_id, rated_user_id, value):
user.profile = request.user.get_profile()
return HttpResponse('success')
这是我的URL.py
url(r'^rate_api/(?P<rating_user_id>.+?)/(?P<rated_user_id>.+?)/$', 'v1_1.views.rate_api'),
我得到以下错误
TypeError at /rate_api/variable1/variable2/variable3/
rate_api() takes exactly 4 arguments (3 given)
Request Method: GET
我认为参数请求没有通过。如何修复此问题:/不,没有传递的是
值
参数,因为您没有在正则表达式中捕获它
TypeError at /rate_api/variable1/variable2/variable3/
rate_api() takes exactly 4 arguments (3 given)
Request Method: GET