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

Page URL construction assumes that Wagtail is serving pages from the root path #69

Closed
gasman opened this issue Feb 18, 2014 · 1 comment
Assignees
Milestone

Comments

@gasman
Copy link
Collaborator

gasman commented Feb 18, 2014

We want it to be possible to incorporate Wagtail into a Django project at a base URL other than the root, e.g. http://example.com/pages/ . However, the methods for constructing page URLs (Page.full_url, Page.url, Page.relative_url in wagtailcore/models.py) do not take this into account, and just return the path that Wagtail knows about from its tree (/path/to/page/ rather than /pages/path/to/page/).

A quick fix would be to run the generated path through django.core.urlresolvers.reverse so that it picks up any prefix defined in the URL config - however, this wouldn't work for multi-site installations that have Wagtail rooted at different places on different sites. (This would typically be done by setting up a separate wsgi instance for each site, with its own settings module and urlconf, in which case the instance generating the URL may not even be able to see the relevant urlconf.) A more robust approach would be to extend the Site record to define a root path as well as a hostname.

@tomdyson tomdyson added this to the 0.5 milestone May 22, 2014
@davecranwell davecranwell modified the milestones: 0.6, 0.5 Jul 24, 2014
@gasman
Copy link
Collaborator Author

gasman commented Aug 12, 2014

Fixed in #531 - we can revisit the corner-cases with multiple sites as and when those corner cases actually come up.

@gasman gasman closed this as completed Aug 12, 2014
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

No branches or pull requests

3 participants