我在搜索页面上遇到问题,在数据库中成功搜索关键字后,它给了我结果,但是当我在该搜索页面上单击该结果时,它没有将我定向到原始帖子,让我显示如果有人可以帮助我,我的意思是什么;
I need this >>> /blog/blogpost/my_article
Instead i am redirected to this >>>/blog/search/blogpost/my_article
def search(request):
query = request.GET['search']
myposts = Blogpost.objects.filter(title__icontains=query)
context = {'myposts': myposts}
return render(request, 'blog/search.html', context)
path("search/", views.search, name="search")
{ # 是一个项目里面的APP}
如果你明白我在说什么,请告诉我,谢谢