Merge pull request #294 from Shybert/django-4-compat

`url` -> `re_path`
This commit is contained in:
Dave Hall 2022-02-20 16:56:29 +00:00 committed by GitHub
commit c05267cca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"),
]