Skip to content

Commit cdab881

Browse files
authored
Merge pull request #295 from asherf/django
Fix django deprecations
2 parents 1ebed3d + 0cf5433 commit cdab881

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In your urls.py:
6565
```python
6666
urlpatterns = [
6767
...
68-
url('', include('django_prometheus.urls')),
68+
path('', include('django_prometheus.urls')),
6969
]
7070
```
7171

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
from django.conf.urls import include, url
21
from django.contrib import admin
2+
from django.urls import include, path, re_path
33
from testapp import views
44

55
urlpatterns = [
6-
url(r"^$", views.index),
7-
url(r"^help$", views.help),
8-
url(r"^slow$", views.slow, name="slow"),
9-
url(r"^objection$", views.objection),
10-
url(r"^sql$", views.sql),
11-
url(r"^newlawn/(?P<location>[a-zA-Z0-9 ]+)$", views.newlawn),
12-
url(r"^file$", views.file),
13-
url("", include("django_prometheus.urls")),
14-
url(r"^admin/", admin.site.urls),
6+
re_path(r"^$", views.index),
7+
re_path(r"^help$", views.help),
8+
re_path(r"^slow$", views.slow, name="slow"),
9+
re_path(r"^objection$", views.objection),
10+
re_path(r"^sql$", views.sql),
11+
re_path(r"^newlawn/(?P<location>[a-zA-Z0-9 ]+)$", views.newlawn),
12+
re_path(r"^file$", views.file),
13+
path("", include("django_prometheus.urls")),
14+
re_path(r"^admin/", admin.site.urls),
1515
]

documentation/exports.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include('django_prometheus.urls') with no prefix like so:
88
```python
99
urlpatterns = [
1010
...
11-
url('', include('django_prometheus.urls')),
11+
path('', include('django_prometheus.urls')),
1212
]
1313
```
1414

@@ -20,7 +20,7 @@ need to configure Prometheus to use that path instead of the default.
2020
```python
2121
urlpatterns = [
2222
...
23-
url('^monitoring/', include('django_prometheus.urls')),
23+
path('monitoring/', include('django_prometheus.urls')),
2424
]
2525
```
2626

0 commit comments

Comments
 (0)