Попробовал сделать следующим образом:
class DynamicURLConf(object):
urlpatterns = None
def __init__(self, pages):
self.urlpatterns = patterns('',
url(r'^$', 'app.account.site.views.test'),
url(r'^test/$', 'app.account.site.views.test'),
)
def page_dispatcher(request, path):
func, args, kwargs = resolve(urlparse("/" + path + "/")[2], DynamicURLConf(pages=None))
kwargs['request'] = request
return func(*args, **kwargs)
def test(request):
return HttpResponse("I am test")
В итоге получаю странную ошибку:
Using the URLconf defined in app.account.site.urls, Django tried these URL patterns, in this order:
^$
^test/$
The current URL, test/, didn't match any of these.
Ведь второй паттерн подходит...