From ddd63bdb59c0352fdee1389ad666750fc60104b3 Mon Sep 17 00:00:00 2001 From: Meteor0id <34976212+Meteor0id@users.noreply.github.com> Date: Fri, 13 Jul 2018 20:58:21 +0200 Subject: [PATCH 1/2] Update integrating_into_django.rst (#4686) * Update integrating_into_django.rst flaw in url, was still referencing depreciated method, fixed. * Update integrating_into_django.rst Add important notice that versions of Django earlier than 2.0 require url() instead of re_path() --- docs/getting_started/integrating_into_django.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/getting_started/integrating_into_django.rst b/docs/getting_started/integrating_into_django.rst index fdf160126c..44fb644470 100644 --- a/docs/getting_started/integrating_into_django.rst +++ b/docs/getting_started/integrating_into_django.rst @@ -77,6 +77,11 @@ Now make the following additions to your ``urls.py`` file: ... ] +.. important:: + + The example aboves assumes you are using Django version 2.0 or later. If you are using a Django version earlier than 2.0, you should rename all occurrences of re_path() to url(). For example: ``from django.urls import path, url, include`` instead of ``from django.urls import path, re_path, include`` and ``url(r'^cms/', include(wagtailadmin_urls)),`` instead of ``re_path(r'^cms/', include(wagtailadmin_urls)),``. + (`read more `_). + The URL paths here can be altered as necessary to fit your project's URL scheme. ``wagtailadmin_urls`` provides the admin interface for Wagtail. This is separate from the Django admin interface (``django.contrib.admin``); Wagtail-only projects typically host the Wagtail admin at ``/admin/``, but if this would clash with your project's existing admin backend then an alternative path can be used, such as ``/cms/`` here. @@ -87,7 +92,7 @@ The URL paths here can be altered as necessary to fit your project's URL scheme. .. code-block:: python - url(r'', include(wagtail_urls)), + re_path(r'', include(wagtail_urls)), In this case, this should be placed at the end of the ``urlpatterns`` list, so that it does not override more specific URL patterns. From d49bc214692be2c772d69471752c4119eb7a76da Mon Sep 17 00:00:00 2001 From: Meteor0id <34976212+Meteor0id@users.noreply.github.com> Date: Fri, 13 Jul 2018 23:13:35 +0200 Subject: [PATCH 2/2] one letter spelling mistake Had been merged by the time I noticed my own mistake. Corrected 1 letter. --- docs/getting_started/integrating_into_django.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/integrating_into_django.rst b/docs/getting_started/integrating_into_django.rst index 44fb644470..d6f55a15a8 100644 --- a/docs/getting_started/integrating_into_django.rst +++ b/docs/getting_started/integrating_into_django.rst @@ -79,7 +79,7 @@ Now make the following additions to your ``urls.py`` file: .. important:: - The example aboves assumes you are using Django version 2.0 or later. If you are using a Django version earlier than 2.0, you should rename all occurrences of re_path() to url(). For example: ``from django.urls import path, url, include`` instead of ``from django.urls import path, re_path, include`` and ``url(r'^cms/', include(wagtailadmin_urls)),`` instead of ``re_path(r'^cms/', include(wagtailadmin_urls)),``. + The example above assumes you are using Django version 2.0 or later. If you are using a Django version earlier than 2.0, you should rename all occurrences of re_path() to url(). For example: ``from django.urls import path, url, include`` instead of ``from django.urls import path, re_path, include`` and ``url(r'^cms/', include(wagtailadmin_urls)),`` instead of ``re_path(r'^cms/', include(wagtailadmin_urls)),``. (`read more `_). The URL paths here can be altered as necessary to fit your project's URL scheme.