Django syntax error in URLConf
题
I'm trying to create a named URL that I can refer to in my templates to point to a page with various parameters but I am getting a syntax error for the following line:
(r'^page/(?P<page_id>\d+)/(?P<page_slug>[-\w]+)/$', 'cms.views.detail', name='page_view'),
If I remove the name='page_view' part, the error goes away.
Can anyone see what I've done wrong?
Any advice appreciated.
Thanks.
解决方案
Does it change if you put the url() around it instead of just parentheses?
不隶属于 StackOverflow