mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
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 <auvipy@gmail.com>
This commit is contained in:
parent
5cc1028c2f
commit
f593f5752c
|
@ -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"))
|
||||
]
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user