kopia lustrzana https://github.com/dukethis/activitypub-example
rodzic
9fdeaa6cb6
commit
f8989f58ae
|
@ -7,6 +7,7 @@ from activitypub.views import followers, noop
|
|||
urlpatterns = [
|
||||
url(r'^@(\w+)/notes/(\w+)', note, name="note"),
|
||||
url(r'^@(\w+)/notes', notes, name="notes"),
|
||||
url(r'^@(\w+)/followers', followers, name="followers"),
|
||||
url(r'^@(\w+)/outbox', outbox, name="outbox"),
|
||||
url(r'^@([^/]+)$', person, name="person"),
|
||||
url(r'^admin/', admin.site.urls),
|
||||
|
|
|
@ -65,3 +65,10 @@ def notes(request, username):
|
|||
# )
|
||||
return JsonResponse(collection.to_json(context=True))
|
||||
|
||||
def followers(request, username):
|
||||
person = get_object_or_404(Person, username=username)
|
||||
followers = activities.OrderedCollection(person.followers.all())
|
||||
actor = activities.Person(id="http://bob.local/@bob",name="Bob")
|
||||
followers.items.append(actor)
|
||||
return JsonResponse(followers.to_json(context=True))
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue