Thanks jnns for the response. I tried adding the backslash but it still doesn't match. Would I need to put a different character after the other entries in the expression? What I mean would there be a different character used in "(?P<month>\[a-z]{3})" ? Also one more note if I type in http://127.0.0.1:8000/blog/ then the page loads using the list.html template as it should. I have included the main urls.py as well as the blog urls.py
Thanks for responding! Antti main urls.py from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^anttipetaisto/', include('anttipetaisto.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), (r'^tags/(?P<slug>[a-zA-Z0-9_.-]+)/$', 'anttipetaisto.tag_views.tag_detail'), (r'^blog/', include('anttipetaisto.blog.urls')), (r'^static_files/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/antti/django/anttipetaisto/static_files'}), ) blog urls.py from django.conf.urls.defaults import * from anttipetaisto.blog.models import Entry from tagging.views import tagged_object_list info_dict = { 'queryset': Entry.objects.filter(status=1), 'date_field': 'pub_date', } urlpatterns = patterns('django.views.generic.date_based', (r'(?P<year>\d{4})/(?P<month>\[a-z]{3})/(?P<day>\w{1,2})/(?P<slug> \[-w]+)/$', 'object_detail', dict(info_dict, slug_field='slug', template_name='blog/detail.html')), (r'^(?P<year>\d{4})/(?P<month>\[a-z]{3})/(?P<day>\w{1,2})/(? P<slug>\[-w]+)/$', 'object_detail', dict(info_dict, template_name='blog/list.html')), (r'^(?P<year>\d{4})/(?P<month>\[a-z]{3})/(?P<day>\w{1,2})/ $','archive_day',dict(info_dict,template_name='blog/list.html')), (r'^(?P<year>\d{4})/(?P<month>\[a-z]{3})/$','archive_month', dict(info_dict, template_name='blog/list.html')), (r'^(?P<year>\d{4})/$','archive_year', dict(info_dict, template_name='blog/list.html')), (r'^$','archive_index', dict(info_dict, template_name='blog/ list.html')), ) On Feb 19, 6:06 pm, jnns <jva...@googlemail.com> wrote: > Hi Antti, > > the url patterns in the tutorial are not correct. The regular > expressions are not using character classes but merely plain > characters. > > ^blog/ ^(?P<year>d{4})/$ > should be > ^blog/ ^(?P<year>\d{4})/$ > > Mind the backslash in \d{4}. This way we're matching for a sequence of > four digits and not for a sequence of four "d"s. > > Regards, > jnns > > On Feb 20, 12:57 am, Antti <ahpetai...@gmail.com> wrote: > > > > > > > > > The problem: > > > I can't seem to get most of my urls that I type in my browser to math > > a url in my urls.py file. I am currently doing Web Monkey's Blog > > Tutorial (http://www.webmonkey.com/2010/02/Get_Started_With_Django/) > > To date everything has worked but when I try to use the urls from the > > blog urls.py I get the following error: > > > Using the URLconf defined in anttipetaisto.urls, Django tried these > > URL patterns, in this order: > > > ^admin/doc/ > > ^admin/ > > ^blog/ (?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[-w] > > +)/$ > > ^blog/ ^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[- > > w]+)/$ > > ^blog/ ^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/$ > > ^blog/ ^(?P<year>d{4})/(?P<month>[a-z]{3})/$ > > ^blog/ ^(?P<year>d{4})/$ > > ^blog/ ^$ > > ^tags/(?P<slug>[a-zA-Z0-9_.-]+)/$ > > ^static_files/(?P<path>.*)$ > > > The current URL, blog/2011/jan/20/things-learned-finland/, didn't > > match any of these. > > > What I don't understand why this is saying that isn't a url match. > > Shouldn't it match the third one down? > > > Thanks > > > Antti -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.