문제

I am receiving the following error message whenever I try to load any item page

TypeError at /item/103/

itemprofile() got an unexpected keyword argument 'item_id'

The following is my urls.py

urlpatterns = patterns('',
#item urls
    ...
    url(r'^item/(?P<item_id>\d+)/$', views.itemprofile, name='itemprofile')
도움이 되었습니까?

해결책

Your regex on URL is completely fine. Add argument item_id to your view function and it should work:

def itemprofile(request, item_id):
    # View codes
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top