404报错,找不到路径:http://127.0.0.1:8000/play/detail/1
^ play / ^ detail / <int:article_id> $
^ play / ^ detail / <int:article_id> $
2019-12-20
url(r'^detail/<int:article_id>$',views.get_detail_page) def get_detail_page(request,article_id): all_article = Article.objects.all() curr_article = None for article in all_article: if article.article_id == article_id: curr_article = article break #curr_article = Article.objects.all()[1] session_list = curr_article.content.split('\n') return render(request,'cs/detail.html', { 'curr_article': curr_article, 'session_list':session_list })
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/play/detail/1 |
Using the URLconf defined in project.urls
, Django tried these URL patterns, in this order:
^play/ ^hello/$
^play/ ^content/$
^play/ ^index/$
^play/ ^detail/<int:article_id>$
^admin/
The current path, play/detail/1
, didn't match any of these.
举报