Noob question to be sure. I am working on the coltrane project from Practical Django Projects, Second Edition.
My urlpattern entry is:
(r'^blog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
The actual URL is: 127.0.0.1:8000/blog/2012/sep/17/thank-you-very-much
The actual URL does not trigger the view – ‘coltrane.views.entry_detail’ – that is associated with the urlpattern entry. Instead, it triggers the catchall pattern at the end of the url pattern tuple. The catchall pattern is:
(r'', include('django.contrib.flatpages.urls')),
When the browser tries to load the page, manage.py reports: [18/Sep/2012 10:59:31] “GET /blog/2012/sep/17/thank-you-very-much HTTP/1.1” 404 1667
The debugging page reports Page not found, No FlatPage matches the given query.
As far as I can figure, everything is in order. So what is my simple, NOOB mistake here?
You have to append the slash at the end of your url because your regex defines that a slash should be matched at the end of the url (
/$)So change it to: