Fix problem in travis with django/python version (#122)

* Fix travis

* Fix url
This commit is contained in:
tomasgarzon 2021-02-14 16:49:14 +01:00 committed by GitHub
parent 71f9ae84e6
commit 07a5e442b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 7 deletions

View file

@ -77,6 +77,8 @@ matrix:
env: DJANGO_VERSION='Django>=1.9,<1.10'
- python: "3.6"
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "3.6"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.7"
env: DJANGO_VERSION='Django>=1.4,<1.5'
- python: "3.7"
@ -91,6 +93,8 @@ matrix:
env: DJANGO_VERSION='Django>=1.9,<1.10'
- python: "3.7"
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "3.7"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.8"
env: DJANGO_VERSION='Django>=1.4,<1.5'
- python: "3.8"

View file

@ -30,12 +30,19 @@ try:
else:
return list(args)
except ImportError: # Django < 1.4
from django.conf.urls.defaults import patterns, url
if VERSION < (4, 0):
from django.conf.urls.defaults import patterns, url
else:
from django.urls import re_path as url
from .views import app_index
urlpatterns = patterns(
'',
url(r'^$', app_index, name='app_index'),
)
if VERSION < (1, 11):
urlpatterns = patterns(
'',
url(r'^$', app_index, name='app_index'),
)
else:
urlpatterns = [
url(r'^$', app_index, name='app_index'),
]

View file

@ -36,8 +36,10 @@ try:
except ImportError: # Django < 1.4
if VERSION < (1, 4):
from django.conf.urls.defaults import include, patterns, url
else:
elif VERSION < (4, 0):
from django.urls import include, url
else:
from django.urls import re_path as url
js_info_dict = {