`url` -> `re_path`

Required for Django 4 compat
This commit is contained in:
Shybert 2022-01-30 09:07:28 +01:00 committed by Guillaume Baffoin
parent 2859fd288e
commit 9a8933c87b
5 changed files with 28 additions and 11 deletions

View File

@ -30,9 +30,14 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
django-version: [2.0, 2.1, 2.2, 3.0, 3.1, 3.2]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
django-version: [2.0, 2.1, 2.2, 3.0, 3.1, 3.2, 4.0]
exclude:
# Django 4.0 is compatible with Python 3.8+
- python-version: "3.6"
django-version: "4.0"
- python-version: "3.7"
django-version: "4.0"
# Python 3.8 is compatible with Django 2.2+
- python-version: "3.8"
django-version: "2.0"
@ -47,6 +52,17 @@ jobs:
django-version: "2.2"
- python-version: "3.9"
django-version: "3.0"
# Python 3.10 is compatible with Django 3.2+
- python-version: "3.10"
django-version: "2.0"
- python-version: "3.10"
django-version: "2.1"
- python-version: "3.10"
django-version: "2.2"
- python-version: "3.10"
django-version: "3.0"
- python-version: "3.10"
django-version: "3.1"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}

View File

@ -17,7 +17,7 @@ Features
* Order results by relevance.
* No need to install additional third-party modules or services.
* Fast and scaleable enough for most use cases.
* Supports Django 1.11+, Python 3.6+.
* Supports Django 2+, Python 3.6+.
Documentation

View File

@ -36,6 +36,8 @@ setup(
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Framework :: Django",
],
)

View File

@ -1,12 +1,11 @@
from django.conf.urls import url, include
from django.contrib import admin
from django.urls import include, re_path
urlpatterns = [
url("^simple/", include("watson.urls")),
re_path("^simple/", include("watson.urls")),
url("^custom/", include("watson.urls"), kwargs={
re_path("^custom/", include("watson.urls"), kwargs={
"query_param": "fooo",
"empty_query_redirect": "/simple/",
"extra_context": {
@ -16,5 +15,5 @@ urlpatterns = [
"paginate_by": 10,
}),
url("^admin/", admin.site.urls),
re_path("^admin/", admin.site.urls),
]

View File

@ -2,14 +2,14 @@
from __future__ import unicode_literals
from django.conf.urls import url
from django.urls import re_path
from watson.views import search, search_json
app_name = 'watson'
urlpatterns = [
url("^$", search, name="search"),
url("^json/$", search_json, name="search_json"),
re_path("^$", search, name="search"),
re_path("^json/$", search_json, name="search_json"),
]