why my urls.py does't work with Django

后端 未结 1 929
野性不改
野性不改 2021-01-24 06:20

Today when I code my blog with \'Building_a_blog_in_30_mins_with_Django_Screencast\',I meet some problems.When I click the title with the article,it can\'t appear the right page

1条回答
  •  广开言路
    2021-01-24 06:28

    You need to add 'app/' in your url.

    url(r'^app/(?P\d+)/$',DetailView.as_view( model=Post, template_name="post.html")),
    

    Or may be you need to define these urls in urls.py of your app (named app ?) and include it in sites main urls.py

    url(r'app/', include('app.urls'))
    

    0 讨论(0)
提交回复
热议问题