Skip to content

Commit 0e04243

Browse files
committed
Update urls.py
- Switch to `django.urls` rather than `django.conf.urls` which is deprecated and will be removed in Django 4.0
1 parent 2800429 commit 0e04243

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ And add the plugin's URLs with `url(r'^map/', include("onisite.plugins.map.urls"
8686
```python
8787
# onisite/urls.py
8888

89-
from django.conf.urls import url, include
89+
from django.urls import include, path, re_path
9090

9191
urlpatterns = [
92-
url(r'^map/', include("onisite.plugins.map.urls")),
92+
re_path(r'^map/', include("onisite.plugins.map.urls")),
9393

9494
# keep this last or else urls from core may override custom urls
95-
url('', include("core.urls")),
95+
path('', include("core.urls")),
9696
]
9797
```
9898

urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from django.conf.urls import url, include
1+
from django.urls import include, path, re_path
22
from onisite.plugins.map import views
33

44
urlpatterns = [
5-
url('', views.map, name="map_home"),
5+
path('', views.map, name="map_home"),
66
]

0 commit comments

Comments
 (0)