kopia lustrzana https://github.com/dukethis/activitypub-example
Implement (for real this time) the following endpoint
GET /@<username>/followingmaster
rodzic
0f950fd974
commit
68f49a2b90
|
@ -1,13 +1,13 @@
|
|||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
|
||||
from activitypub.views import person, note, notes, inbox, outbox, followers
|
||||
from activitypub.views import noop
|
||||
from activitypub.views import person, note, notes, inbox, outbox
|
||||
from activitypub.views import followers, following
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^@(\w+)/notes/(\w+)', note, name="note"),
|
||||
url(r'^@(\w+)/notes', notes, name="notes"),
|
||||
url(r'^@(\w+)/following', noop, name="following"),
|
||||
url(r'^@(\w+)/following', following, name="following"),
|
||||
url(r'^@(\w+)/followers', followers, name="followers"),
|
||||
url(r'^@(\w+)/inbox', inbox, name="inbox"),
|
||||
url(r'^@(\w+)/outbox', outbox, name="outbox"),
|
||||
|
|
|
@ -187,3 +187,8 @@ def followers(request, username):
|
|||
person = get_object_or_404(Person, username=username)
|
||||
followers = activities.OrderedCollection(person.followers.all())
|
||||
return JsonResponse(followers.to_json(context=True))
|
||||
|
||||
def following(request, username):
|
||||
person = get_object_or_404(Person, username=username)
|
||||
following = activities.OrderedCollection(person.following.all())
|
||||
return JsonResponse(following.to_json(context=True))
|
||||
|
|
Ładowanie…
Reference in New Issue