From f593f5752c45e06147231bbfd74c02384791e074 Mon Sep 17 00:00:00 2001 From: rafaelgramoschi <45084757+rafaelgramoschi@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:44:04 +0200 Subject: [PATCH] Update browsable-api.md (#9509) * Update browsable-api.md Deprecated url(), use re_path(). Show imports. * Update docs/topics/browsable-api.md * Update docs/topics/browsable-api.md --------- Co-authored-by: Asif Saif Uddin --- 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 9a95edfc6..fe35be8b3 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, path + urlpatterns = [ # ... - url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) + path("api-auth/", include("rest_framework.urls", namespace="rest_framework")) ] ```