Skip to content

Commit 54884a5

Browse files
Update browsable-api.md
Deprecated url(), use re_path(). Show imports.
1 parent f113ab6 commit 54884a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/topics/browsable-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ By default, the API will return the format specified by the headers, which in th
2020
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:
2121

2222
```python
23+
from django.urls import include, re_path
24+
2325
urlpatterns = [
2426
# ...
25-
url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework"))
27+
re_path(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework"))
2628
]
2729
```
2830

0 commit comments

Comments
 (0)