urls.py 912 Bytes
Newer Older
1
from django.views.generic.base import TemplateView
2 3
from rest_auth.registration.views import SocialAccountListView, \
    SocialAccountDisconnectView
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
from rest_framework.routers import SimpleRouter
from django.conf.urls import url

from . import views

router = SimpleRouter()
router.register(r'', views.UserViewSet),
router.register(r'^me/$', views.UserViewSet.as_view({'get': 'retrieve'}), base_name='me'),

urlpatterns = [
    url(
        regex=r'^key/$',
        view=views.get_api_key,
        name='api-key'
    ),
19
    url(r'^close/$', TemplateView.as_view(template_name='users/close.html')),
20 21 22 23 24 25 26 27 28 29
    url(
        r'^socialaccounts/$',
        SocialAccountListView.as_view(),
        name='social_account_list'
    ),
    url(
        r'^socialaccounts/(?P<pk>\d+)/disconnect/$',
        SocialAccountDisconnectView.as_view(),
        name='social_account_disconnect'
    )
30 31 32
]

urlpatterns.extend(router.urls)