summaryrefslogtreecommitdiffstats
path: root/takahe/urls.py
blob: a87ec87a76b94c3e2f01fc2ab0a403c3f3602111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from django.contrib import admin
from django.urls import path

from activities.views import posts, timelines
from core import views as core
from stator import views as stator
from users.views import activitypub, auth, identity

urlpatterns = [
    path("", core.homepage),
    # Activity views
    path("notifications/", timelines.Notifications.as_view()),
    path("local/", timelines.Local.as_view()),
    path("federated/", timelines.Federated.as_view()),
    # Identity views
    path("@<handle>/", identity.ViewIdentity.as_view()),
    path("@<handle>/actor/", activitypub.Actor.as_view()),
    path("@<handle>/actor/inbox/", activitypub.Inbox.as_view()),
    path("@<handle>/action/", identity.ActionIdentity.as_view()),
    # Posts
    path("@<handle>/posts/<int:post_id>/", posts.Post.as_view()),
    path("@<handle>/posts/<int:post_id>/like/", posts.Like.as_view()),
    path("@<handle>/posts/<int:post_id>/unlike/", posts.Like.as_view(undo=True)),
    path("@<handle>/posts/<int:post_id>/boost/", posts.Boost.as_view()),
    path("@<handle>/posts/<int:post_id>/unboost/", posts.Boost.as_view(undo=True)),
    # Authentication
    path("auth/login/", auth.Login.as_view()),
    path("auth/logout/", auth.Logout.as_view()),
    # Identity selection
    path("@<handle>/activate/", identity.ActivateIdentity.as_view()),
    path("identity/select/", identity.SelectIdentity.as_view()),
    path("identity/create/", identity.CreateIdentity.as_view()),
    # Well-known endpoints
    path(".well-known/webfinger", activitypub.Webfinger.as_view()),
    path(".well-known/host-meta", activitypub.HostMeta.as_view()),
    # Task runner
    path(".stator/runner/", stator.RequestRunner.as_view()),
    # Django admin
    path("djadmin/", admin.site.urls),
]