An app to manage toots (Mastodon posts) in a Django project
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-toots-0.0.1.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for django_toots-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a535262d01675ea11f45e43671ca00d9c3fa0b20ab83dab3fe8289026a8845e |
|
MD5 | c6943cac43f9b5612dd3072d956e0221 |
|
BLAKE2b-256 | a8242c1f9534aa51b107d54d47f4ca4ca6f57881782fbdde7416c6f39921d3ea |