@@ -78,33 +78,19 @@ $ python manage.py migrate
78
78
79
79
``` python
80
80
from django.contrib import admin
81
- from django.urls import path, include # <-- NEW: 'include` directive added
82
-
83
- urlpatterns = [
84
- path(" admin/" , admin.site.urls),
85
- path(' ' , include(' django_dyn_api.urls' )), # <-- NEW: API routing rules
86
- ]
87
- ```
88
-
89
- <br />
90
-
91
- > ** Step #6 ** - ` Update routing ` , include ` DRF ` JWT authentication
92
-
93
- ``` python
94
- from django.contrib import admin
81
+ from django.urls import path, include # <-- UPD: 'include` directive
95
82
from rest_framework.authtoken.views import obtain_auth_token # <-- NEW
96
83
97
84
urlpatterns = [
98
- path(" admin/" , admin.site.urls),
99
-
100
- path(' ' , include(' django_dyn_api.urls' )), # <-- Added in the previous step
101
- path(' login/jwt/' , view = obtain_auth_token), # <-- NEW
85
+ path(" admin/" , admin.site.urls),
86
+ path(' ' , include(' django_dyn_api.urls' )), # <-- NEW
87
+ path(' login/jwt/' , view = obtain_auth_token), # <-- NEW
102
88
]
103
89
```
104
90
105
91
<br />
106
92
107
- > ** Step #7 ** - ` Use API `
93
+ > ** Step #6 ** - ` Use API `
108
94
109
95
If the managed model is ` Books ` , the API interface is ` /api/books/ ` and all CRUD methods are available.
110
96
0 commit comments