mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Tweak the README
This commit is contained in:
parent
b0cf350ec6
commit
eb25a28679
1 changed files with 5 additions and 9 deletions
|
@ -5,11 +5,7 @@ Tiny ActivityPub framework written in Python, both database and server agnostic.
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from little_boxes.activitypub import BaseBackend
|
from little_boxes import activitypub as ap
|
||||||
from little_boxes.activitypub import use_backend
|
|
||||||
from little_boxes.activitypub import Outbox
|
|
||||||
from little_boxes.activitypub import Person
|
|
||||||
from little_boxes.activitypub import Follow
|
|
||||||
|
|
||||||
from mydb import db_client
|
from mydb import db_client
|
||||||
|
|
||||||
|
@ -31,11 +27,11 @@ class MyBackend(BaseBackend):
|
||||||
db_con = db_client()
|
db_con = db_client()
|
||||||
my_backend = MyBackend(db_con)
|
my_backend = MyBackend(db_con)
|
||||||
|
|
||||||
use_backend(my_backend)
|
ap.use_backend(my_backend)
|
||||||
|
|
||||||
me = Person({}) # Init an actor
|
me = ap.Person({}) # Init an actor
|
||||||
outbox = Outbox(me)
|
outbox = ap.Outbox(me)
|
||||||
|
|
||||||
follow = Follow(actor=me, object='http://iri-i-want-follow')
|
follow = ap.Follow(actor=me, object='http://iri-i-want-follow')
|
||||||
outbox.post(follow)
|
outbox.post(follow)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue