In the docs, it's said that if we want the user to be routed to different views when someone requests http://example.com/ and http://customer.example.com/, we can specify that URL pattern in the PUBLIC_SCHEMA_URLCONF file.
But if we want certain views to be available only when requested from public schema, currently we have to have those patterns in both PUBLIC_SCHEMA_URLCONF and ROOT_URLCONF files. And I had to then raise django.views.defaults.page_not_found on the ROOT_URLCONF pattern.
To fix this duplicate pattern issue, I had to add set_urlconf(request.urlconf) in the middleware.
In the docs, it's said that if we want the user to be routed to different views when someone requests http://example.com/ and http://customer.example.com/, we can specify that URL pattern in the
PUBLIC_SCHEMA_URLCONF
file.But if we want certain views to be available only when requested from public schema, currently we have to have those patterns in both
PUBLIC_SCHEMA_URLCONF
andROOT_URLCONF
files. And I had to then raisedjango.views.defaults.page_not_found
on theROOT_URLCONF
pattern.To fix this duplicate pattern issue, I had to add
set_urlconf(request.urlconf)
in the middleware.