You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: