| 1 |
""" |
| 2 |
Login and logout views for the browsable API. |
| 3 |
|
| 4 |
Add these to your root URLconf if you're using the browsable API and |
| 5 |
your API requires authentication: |
| 6 |
|
| 7 |
urlpatterns = [ |
| 8 |
... |
| 9 |
path('auth/', include('rest_framework.urls')) |
| 10 |
] |
| 11 |
|
| 12 |
You should make sure your authentication settings include `SessionAuthentication`. |
| 13 |
""" |
| 14 |
from django.contrib.auth import views |
| 15 |
from django.urls import path |
| 16 |
|
| 17 |
app_name = 'rest_framework' |
| 18 |
urlpatterns = [ |
| 19 |
path('login/', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'), |
| 20 |
path('logout/', views.LogoutView.as_view(), name='logout'), |
| 21 |
] |