今天,当我的代码我的博客以“Building_a_blog_in_30_mins_with_Django_Screencast”,我遇到一些problems.When我点击标题与文章,它不能出现在右页!
Page not found (404)
Request Method: GET
使用在myblog.urls定义的URL配置,Django的尝试这些URL模式,顺序如下:
^$
^(?P<pk>\d+)/$
^admin/
^admin/doc/
目前的网址,应用/ 1,不符合任何这些。
因为你有DEBUG =真在你的Django settings文件你会看到这个错误。 更改为False,和Django会显示一个标准的404页。
它是我的urls.py:
url(r'^$',ListView.as_view(queryset=Post.objects.all().order_by("created[:2]template_name=" blog.html")),
url(r'^(?P<pk>\d+)/$',DetailView.as_view( model=Post, template_name="post.html")),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/doc/', include('django.contrib.admindocs.urls'))
我不konw是怎么回事用it.Please的帮助,谢谢!