I’m playing with django urls.py and have some problems with the named groups syntax
Like this without named groups it works…
urlpatterns = patterns('',
(r'^$',index),
(r'^admin/', include(admin.site.urls)),
(r'^',test),
)
but with named groups i have a syntax error, which i can’t solve
urlpatterns = patterns('',
(r'^$',index),
(r'^admin/', include(admin.site.urls)),
(?P<requrl>r'^',test), # this is new
)
Any help with that?
That’s quite obviously a syntax error. For a start, you have most of the characters outside the quote marks, and secondly, the syntax you have for your “named groups” is not even close to correct.
You should read the documentation more closely, followed by an introduction to regular expressions.