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

Admin subdomains #1807

Open
diveru4i opened this issue Oct 9, 2015 · 1 comment
Open

Admin subdomains #1807

diveru4i opened this issue Oct 9, 2015 · 1 comment

Comments

@diveru4i
Copy link

diveru4i commented Oct 9, 2015

Greetings.

Is there a way to properly serve wagtail admin site on a different subdomain (eg. admin.example.com)?

I've patched django-subdomains middleware so it would work with wagtail.wagtailcore.models.Site, but now all reverse urls in admin point to admin.example.com/--uri--/. To fix this I need to patch wagtail.wagtailcore.models.Page.url, but I just don't want to monkey-patch source packages.

Is there any way around that? And maybe in the future you could implement the settings.DEFAULT_PAGE_MODEL setting for wagtail, so we could override some default behaviour?

Thanks.

@gasman
Copy link
Collaborator

gasman commented Oct 9, 2015

That's an interesting one! We intentionally don't include domains in the result of Page.url when there's only one Site record configured, so that links work immediately on a new Wagtail project without having to edit the site configuration. But that doesn't help if you're using multiple domains for hosting things other than Wagtail site entry points (such as the Wagtail admin)...

As a workaround, you could create a dummy site record (create a new page at the root level, and add a Site record in Settings -> Sites pointing to that page, using any hostname you like) - this will cause Page.url to always generate full URLs.

I guess the proper fix would be to add an "always generate full URLs" flag to settings - I can't see any more elegant way of handling this.

Re settings.DEFAULT_PAGE_MODEL, that's covered by issue #836. (No progress on it yet, though...)

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

No branches or pull requests

2 participants