1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from django.urls import path, include
5 from django.views.decorators.csrf import csrf_exempt
6 from django.views.generic import TemplateView
8 from stats.utils import piwik_track_view
13 path('login/', csrf_exempt(views.LoginView.as_view())),
14 path('', include('catalogue.api.urls2')),
19 path('2/', include((urlpatterns1, 'api'), namespace="v2")),
21 path('oauth/request_token/', csrf_exempt(views.OAuth1RequestTokenView.as_view())),
22 path('oauth/authorize/', views.oauth_user_auth, name='oauth_user_auth'),
23 path('oauth/access_token/', csrf_exempt(views.OAuth1AccessTokenView.as_view())),
24 path('login/', csrf_exempt(views.LoginView.as_view())),
26 path('', TemplateView.as_view(template_name='api/main.html'), name='api'),
28 # info boxes (used by mobile app)
29 path('book/<int:book_id>/info.html', catalogue.views.book_info),
30 path('tag/<int:tag_id>/info.html', catalogue.views.tag_info),
33 path('reading/<slug:slug>/',
34 piwik_track_view(views.BookUserDataView.as_view()),
36 path('reading/<slug:slug>/<slug:state>/',
37 piwik_track_view(views.BookUserDataView.as_view()),
40 piwik_track_view(views.UserView.as_view()),
44 piwik_track_view(views.BlogView.as_view())),
46 path('', include('social.api.urls')),
47 path('', include('catalogue.api.urls')),