This seems to not work in django:
urlpatterns = [
url(r'^%s/admin/' %(BASE_PATH), include(admin.site.urls)),
url(r'^%s/$' %(BASE_PATH), home_view),
url(r'^%s/ping/$' %(BASE_PATH), ping),
url(r'^%s/echo/$' %(BASE_PATH), echo),
url(gcd_str, gcd),
]
If I set the BASE_PATH to 'test' and go to http://host/test/echo I get a 404 error but my paths look like this on the error page:
^/test/admin/
^/test/$
^/test/ping/$
^/test/echo/$
^/test/gcd/$
If I hard-code like this it works:
urlpatterns = [
url(r'^test/admin/', include(admin.site.urls)),
url(r'^test/$', home_view),
url(r'^test/ping/$', ping),
url(r'^test/echo/$', echo),
]
I guess that the pattern does not get interpolated correctly, if I use a string without the r it seems to behave the same.