mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-22 15:44:46 +00:00
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()
This commit is contained in:
parent
8f4e5278de
commit
ddd63bdb59
1 changed files with 6 additions and 1 deletions
|
|
@ -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 <https://docs.djangoproject.com/en/2.1/ref/urls/#url>`_).
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue