I’ve been trying various combinations to write the url for the absolute path of my single blog posts at my page.
here is what I need to get right:
mypage.com/blog/2012/6/dasdf/
this is obviously not working, I also tried with named groups ?P :
(r'^\d{4}/d{1,2}/(?P<path>.*)/$', detail),
Can you show me how it should be done so I can see where I am wrong?
p.s here is the error
The current URL, blog/2012/6/dasdf/, didn't match any of these.
Thanks in advance.
I guess you’re missing the ‘blog’ argument from your path. Furthermore, I always recommend to try to be restrictive with the allowed characters, since you exactly know what you can expect to receive in your url. I don’t know how you imported ‘detail’, but you probably want to refer to it as something like ‘application.views.detail’. Named arguments make sure that you can easily change the order of arguments in the future.
I guess something like this should work:
Otherwise, I’d suggest checking whether the url you have created matches the urls Django provides with the error message.