0

I've been trying everything, but I can't get these numbers to match. Am I missing anything here? Like a non-default module?

    Page not found (404)
    Request Method: GET
    Request URL:    http://example.com/blog/1/1/1/
    Using the URLconf defined in blog.urls, Django tried these URL patterns, in this order:
    ^blog/(?P\d{4})/(?P\d{2})/(?P\d{2})/$
    ^blog/(\d+)/(\d+)/(\d+)/$
    The current URL, , didn't match any of these.

Also, my urls.py file:

from django.conf.urls import patterns, include, url                                                  
import views                                                                                         
from views import hello_world, date_try, blog_test                                                   

urlpatterns = patterns('',                                                                           
    url(r'^blog/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$', views.date_try),                 
    url(r'^blog/(\d+)/(\d+)/(\d+)/$', 'date_try'),                                                   
)                                                                                                    
1
  • 1
    Is that your root urlconf, or is it being included by another urlconf? Commented Jul 25, 2012 at 20:59

1 Answer 1

0

I think \d{4} is only going to match exactly 4 digits. Try \d{1,4}.

It looks like Django thinks your URL is empty. How are you running Django? Is this answer useful?

Sign up to request clarification or add additional context in comments.

2 Comments

^blog/(\d+)/(\d+)/(\d+)/$ should match blog/1/1/1/
Glad I can help! If this did solve your problem, could you accept my answer? Accepting answers helps make Stack Overflow better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.