diff --git a/docs/advanced_topics/api/v2/configuration.rst b/docs/advanced_topics/api/v2/configuration.rst index ae02abcdb..64a3cea9d 100644 --- a/docs/advanced_topics/api/v2/configuration.rst +++ b/docs/advanced_topics/api/v2/configuration.rst @@ -88,6 +88,9 @@ Next, register the URLs so Django can route requests into the API: url(r'^api/v2/', api_router.urls), ... + + # Ensure that the api_router line appears above the default Wagtail page serving route + url(r'', include(wagtail_urls)), ] With this configuration, pages will be available at ``/api/v2/pages/``, images diff --git a/docs/advanced_topics/images/image_serve_view.rst b/docs/advanced_topics/images/image_serve_view.rst index 854b34b80..d7fd0c6eb 100644 --- a/docs/advanced_topics/images/image_serve_view.rst +++ b/docs/advanced_topics/images/image_serve_view.rst @@ -27,6 +27,11 @@ Add an entry for the view into your URLs configuration: ... url(r'^images/([^/]*)/(\d*)/([^/]*)/[^/]*$', ServeView.as_view(), name='wagtailimages_serve'), + + ... + + # Ensure that the wagtailimages_serve line appears above the default Wagtail page serving route + url(r'', include(wagtail_urls)), ] Usage diff --git a/docs/reference/contrib/api/installation.rst b/docs/reference/contrib/api/installation.rst index f2bfe3f21..8dbfdd498 100644 --- a/docs/reference/contrib/api/installation.rst +++ b/docs/reference/contrib/api/installation.rst @@ -20,5 +20,11 @@ To install, add ``wagtail.contrib.wagtailapi`` and ``rest_framework`` to ``INSTA urlpatterns = [ ... + url(r'^api/', include(wagtailapi_urls)), + + ... + + # Ensure that the wagtailapi_urls line appears above the default Wagtail page serving route + url(r'', include(wagtail_urls)), ] diff --git a/docs/reference/contrib/sitemaps.rst b/docs/reference/contrib/sitemaps.rst index 40e330fd0..83baeee7a 100644 --- a/docs/reference/contrib/sitemaps.rst +++ b/docs/reference/contrib/sitemaps.rst @@ -30,6 +30,11 @@ Then, in ``urls.py``, you need to add a link to the ``wagtail.contrib.wagtailsit ... url('^sitemap\.xml$', sitemap), + + ... + + # Ensure that the 'sitemap' line appears above the default Wagtail page serving route + url(r'', include(wagtail_urls)), ] diff --git a/wagtail/project_template/project_name/urls.py b/wagtail/project_template/project_name/urls.py index df3f5bbe5..19c40f0e0 100644 --- a/wagtail/project_template/project_name/urls.py +++ b/wagtail/project_template/project_name/urls.py @@ -17,7 +17,14 @@ urlpatterns = [ url(r'^search/$', search_views.search, name='search'), + # For anything not caught by a more specific rule above, hand over to + # Wagtail's page serving mechanism. This should be the last pattern in + # the list: url(r'', include(wagtail_urls)), + + # Alternatively, if you want Wagtail pages to be served from a subpath + # of your site, rather than the site root: + # url(r'^pages/', include(wagtail_urls)), ]