Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set URL conf for PUBLIC_SCHEMA_URLCONF to avoid URL pattern duplication #604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jibusayone
Copy link

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.

@Nicolas-Coeficiente
Copy link

i'm using django-tenants, how can i request the same commit for it?
django-tenants it's a fork of django-tenant-schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants