From 54884a53aa36704ef68574f73073365d2259f120 Mon Sep 17 00:00:00 2001 From: rafaelgramoschi <45084757+rafaelgramoschi@users.noreply.github.com> Date: Wed, 21 Aug 2024 22:33:54 +0200 Subject: [PATCH 1/3] Update browsable-api.md Deprecated url(), use re_path(). Show imports. --- docs/topics/browsable-api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/topics/browsable-api.md b/docs/topics/browsable-api.md index 9a95edfc60..b4a8adb178 100644 --- a/docs/topics/browsable-api.md +++ b/docs/topics/browsable-api.md @@ -20,9 +20,11 @@ By default, the API will return the format specified by the headers, which in th To quickly add authentication to the browesable api, add a routes named `"login"` and `"logout"` under the namespace `"rest_framework"`. DRF provides default routes for this which you can add to your urlconf: ```python +from django.urls import include, re_path + urlpatterns = [ # ... - url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) + re_path(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) ] ``` From bf77df6d396cd2c5d6d355236b3bd101bb88f277 Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Tue, 27 Aug 2024 13:37:55 +0600 Subject: [PATCH 2/3] Update docs/topics/browsable-api.md --- docs/topics/browsable-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/browsable-api.md b/docs/topics/browsable-api.md index b4a8adb178..e02d8e6456 100644 --- a/docs/topics/browsable-api.md +++ b/docs/topics/browsable-api.md @@ -20,7 +20,7 @@ By default, the API will return the format specified by the headers, which in th To quickly add authentication to the browesable api, add a routes named `"login"` and `"logout"` under the namespace `"rest_framework"`. DRF provides default routes for this which you can add to your urlconf: ```python -from django.urls import include, re_path +from django.urls import include, path urlpatterns = [ # ... From e77eec0ff270b66dfad1dc0987ea0f69cf6ee501 Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Tue, 27 Aug 2024 13:38:03 +0600 Subject: [PATCH 3/3] Update docs/topics/browsable-api.md --- docs/topics/browsable-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/browsable-api.md b/docs/topics/browsable-api.md index e02d8e6456..fe35be8b31 100644 --- a/docs/topics/browsable-api.md +++ b/docs/topics/browsable-api.md @@ -24,7 +24,7 @@ from django.urls import include, path urlpatterns = [ # ... - re_path(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) + path("api-auth/", include("rest_framework.urls", namespace="rest_framework")) ] ```