django - I can seem to get right the urlconf line for my absolute path -


i've been trying various combinations write url absolute path of single blog posts @ page. here need right:

mypage.com/blog/2012/6/dasdf/

this not working, tried named groups ?p :

(r'^\d{4}/d{1,2}/(?p<path>.*)/$', detail), 

can show me how should done can see wrong?

p.s here error

the current url, blog/2012/6/dasdf/, didn't match of these. 

thanks in advance.

i guess you're missing 'blog' argument path. furthermore, recommend try restrictive allowed characters, since know can expect receive in url. don't know how imported 'detail', want refer 'application.views.detail'. named arguments make sure can change order of arguments in future.

i guess should work:

(r'^blog/(?p<year>([0-9]{4}))/(?p<month>\d{1,2})/(?p<path>[a-za-z0-9-]+)/$', 'application.views.detail'), 

otherwise, i'd suggest checking whether url have created matches urls django provides error message.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -