Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django1.5版本中出现错误,未找到参数为“()”且关键字参数为“{}”的“lebay_user_home”_Python_Django_Web - Fatal编程技术网

Python django1.5版本中出现错误,未找到参数为“()”且关键字参数为“{}”的“lebay_user_home”

Python django1.5版本中出现错误,未找到参数为“()”且关键字参数为“{}”的“lebay_user_home”,python,django,web,Python,Django,Web,我正在尝试将我在网上找到的一个名为“小ebay”的项目从django 1.2升级到1.5。 我不能解决这个问题。。。NoReverseMatch错误:找不到参数和关键字参数“{}”的“lebay_user_home”的反向 这是我的URL.py文件 url(r'^profile/user/(?P<user_id>\d+)/$', lebay_views.view_user_profile, name='lebay_view_user_profile'), 这是模板中给出错误的那一行

我正在尝试将我在网上找到的一个名为“小ebay”的项目从django 1.2升级到1.5。 我不能解决这个问题。。。NoReverseMatch错误:找不到参数和关键字参数“{}”的“lebay_user_home”的反向

这是我的URL.py文件

url(r'^profile/user/(?P<user_id>\d+)/$', lebay_views.view_user_profile, name='lebay_view_user_profile'),
这是模板中给出错误的那一行

<a href="{% url 'com:lebay_view_user_profile' request.user.user.pk %}">View Profile</a>
请帮帮我,伙计们,我快疯了。谢谢

这是错误的请求。user.user.pk应该是request.user.pk:


有关更多信息,请查看

这是lebay_user_home的url

url(r'^home/$', lebay_views.view_user_home, name='lebay_user_home'),
这是相关的观点

@login_required
def view_user_home(request):
item__status=AUCTION_ITEM_STATUS_RUNNING)
won_auctions = AuctionEvent.objects.filter(winning_bidder=request.user.user,  item__status=AUCTION_ITEM_STATUS_SOLD)
listable_items = Item.objects.filter(seller=request.user.user, status=AUCTION_ITEM_STATUS_IDLE)

return render_to_response('lebay/view_user_home.html', {
    'current_auctions': current_auctions,
    'won_auctions': won_auctions,
    'listable_items': listable_items,
}, context_instance=RequestContext(request))

我不认为名为lebay_view_user_profile的URL会引起问题,因为在错误中URL名为lebay_user_home??我正在发布lebay_user_home??您是否在ROOT_URL_CONF中为应用程序lebay_视图设置了名称空间?好的,很遗憾我无法发布视图,我必须等待,因为论坛规则。是的,当我导入我作为lebay_视图编写的视图时,我可以用这种方式调用它们。程序只分为3个文件,我应该发布它们吗?
url(r'^home/$', lebay_views.view_user_home, name='lebay_user_home'),
@login_required
def view_user_home(request):
item__status=AUCTION_ITEM_STATUS_RUNNING)
won_auctions = AuctionEvent.objects.filter(winning_bidder=request.user.user,  item__status=AUCTION_ITEM_STATUS_SOLD)
listable_items = Item.objects.filter(seller=request.user.user, status=AUCTION_ITEM_STATUS_IDLE)

return render_to_response('lebay/view_user_home.html', {
    'current_auctions': current_auctions,
    'won_auctions': won_auctions,
    'listable_items': listable_items,
}, context_instance=RequestContext(request))