django.conf.urls is deprecated and will be removed in Django 4.0, use django.urls.re_path instead

Signed-off-by: Yohann D'ANELLO <ynerant@¢rans.org>
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2020-12-22 23:07:33 +01:00
parent 10b389e7be
commit d62def6d6b
2 changed files with 35 additions and 14 deletions

View File

@ -13,10 +13,20 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
import django
if django.VERSION < (2,):
from django.conf.urls import url
re_path = url
else:
from django.urls import re_path
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('cas_server.urls', namespace='cas_server')),
re_path(r'^admin/', admin.site.urls),
re_path(r'^', include('cas_server.urls', namespace='cas_server')),
]