authtoken.py 525 Bytes
Newer Older
1
from django.conf.urls import url
2

3 4
from djoser import views

5 6 7

urlpatterns = [
    url(
8
        r'^token/create/?$',
9 10 11
        views.TokenCreateView.as_view(),
        name='token-create'
    ),
12
    url(
13
        r'^token/destroy/?$',
14 15
        views.TokenDestroyView.as_view(),
        name='token-destroy'
16
    ),
17 18 19 20 21 22 23 24 25 26
    url(
        r'^token/login/?$',
        views.TokenCreateView.as_view(),
        name='login'
    ),
    url(
        r'^token/logout/?$',
        views.TokenDestroyView.as_view(),
        name='logout'
    ),
27
]