Remove Django 1.11 support from code and docs

pull/4818/head
Matt Westcott 2018-10-17 14:54:18 +01:00 zatwierdzone przez Matt Westcott
rodzic f56318a67b
commit e844200f27
4 zmienionych plików z 11 dodań i 14 usunięć

Wyświetl plik

@ -51,11 +51,11 @@ Wagtail is used by NASA, Google, Oxfam, the NHS, Mozilla, MIT, the Red Cross, Sa
Wagtail supports:
* Django 1.11.x, 2.0.x and 2.1.x
* Django 2.0.x and 2.1.x
* Python 3.4, 3.5 and 3.6
* PostgreSQL, MySQL and SQLite as database backends
Previous versions of Wagtail (1.13 and earlier) additionally supported Python 2.7.
Previous versions of Wagtail (1.13 and earlier) additionally supported Python 2.7 and Django 1.x.
---

Wyświetl plik

@ -5,7 +5,7 @@ Integrating Wagtail into a Django project
Wagtail provides the ``wagtail start`` command and project template to get you started with a new Wagtail project as quickly as possible, but it's easy to integrate Wagtail into an existing Django project too.
Wagtail is currently compatible with Django 1.11, 2.0 and 2.1. First, install the ``wagtail`` package from PyPI:
Wagtail is currently compatible with Django 2.0 and 2.1. First, install the ``wagtail`` package from PyPI:
.. code-block:: console

Wyświetl plik

@ -21,3 +21,8 @@ Bug fixes
Upgrade considerations
======================
Removed support for Django 1.11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Django 1.11 is no longer supported in this release; please upgrade your project to Django 2.0 or 2.1 before upgrading to Wagtail 2.4.

Wyświetl plik

@ -1,17 +1,12 @@
import django
from django.conf.urls import url
from django.http import Http404
from django.template.response import TemplateResponse
from django.urls import URLResolver
from django.urls.resolvers import RegexPattern
from wagtail.core.models import Page
from wagtail.core.url_routing import RouteResult
if django.VERSION >= (2, 0):
from django.urls import URLResolver
from django.urls.resolvers import RegexPattern
else:
from django.urls.resolvers import RegexURLResolver
_creation_counter = 0
@ -76,10 +71,7 @@ class RoutablePageMixin:
def get_resolver(cls):
if '_routablepage_urlresolver' not in cls.__dict__:
subpage_urls = cls.get_subpage_urls()
if django.VERSION >= (2, 0):
cls._routablepage_urlresolver = URLResolver(RegexPattern(r'^/'), subpage_urls)
else: # Django 1.11 fallback
cls._routablepage_urlresolver = RegexURLResolver(r'^/', subpage_urls)
cls._routablepage_urlresolver = URLResolver(RegexPattern(r'^/'), subpage_urls)
return cls._routablepage_urlresolver