[Answer]-Regex URL in django doesnt work

1👍

You’re requiring two trailing slashes, since your path subcomponents have to end with one in the subgroup definition and then you also have /$ at the end of your pattern. Depending on what your pattern should contain, either remove the final / or use a named group that has the final / optional.

That is, either:

url(r'^fotogalerie/(?P<nazev_slozky>([^/]+/)+)$', fotogalerie_slozka),

if you want your captured argument to be so/on/, or:

url(r'^fotogalerie/(?P<nazev_slozky>([^/]+/?)+)/$', fotogalerie_slozka),

if you want your captured argument to be so/on.

Leave a comment