django-toots 0.0.1

Creator: codyrutscher

Last updated:

Add to Cart

Description:

djangotoots 0.0.1

django-toots
Create and delete toots in a Django project.
This package takes advantage of the Mastodon.py functionalities to connect it to a Django Backend.
Set up

Install from PyPI

python -m pip install django-toots


Add the package to your settings INSTALLED_APPS

INSTALLED_APPS = [
...
"django_toots",
...
]


Add the following settings to your Django project.

Example:
import os
from dotenv import load_dotenv
load_dotenv()

...

# django-toots
MASTODON_ACCESS_TOKEN=os.environ.get("MASTODON_ACCESS_TOKEN", "")
MASTODON_API_BASE_URL = "https://fosstodon.org"


Run migrations

python manage.py migrate


Usage
TODO: Document this!
Create a simple toot
from django_toots.models import Toot

# create a toot in the db
t = Tweet.objects.create(text="Hi, this is my toot using django-toots and Mastodon.py")

# publish it
t.publish()

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.