{"id":23964566,"url":"https://github.com/ramibch/django-toots","last_synced_at":"2026-05-02T22:33:30.739Z","repository":{"id":193771726,"uuid":"689460021","full_name":"ramibch/django-toots","owner":"ramibch","description":"An app to manage toots (Mastodon posts) in a Django project","archived":false,"fork":false,"pushed_at":"2023-09-11T21:06:41.000Z","size":6662,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T06:22:08.882Z","etag":null,"topics":["api","django","django-app","django-application","django-apps","mastodon","mastodon-api","mastodon-client","python","python3","toot"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-toots/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramibch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-09T21:57:45.000Z","updated_at":"2024-05-31T02:26:31.000Z","dependencies_parsed_at":"2024-11-10T07:45:20.194Z","dependency_job_id":"fb928acf-f18a-4035-ad93-734375013928","html_url":"https://github.com/ramibch/django-toots","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"857081d6b74ba2257f41c0b8c7072a80c1a84617"},"previous_names":["ramiboutas/django-toots","ramibch/django-toots"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ramibch/django-toots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramibch%2Fdjango-toots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramibch%2Fdjango-toots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramibch%2Fdjango-toots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramibch%2Fdjango-toots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramibch","download_url":"https://codeload.github.com/ramibch/django-toots/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramibch%2Fdjango-toots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","django","django-app","django-application","django-apps","mastodon","mastodon-api","mastodon-client","python","python3","toot"],"created_at":"2025-01-06T21:44:40.041Z","updated_at":"2026-03-02T05:32:33.131Z","avatar_url":"https://github.com/ramibch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-toots\n\nCreate and delete toots in a Django project.\n\nThis package takes advantage of the [Mastodon.py](https://pypi.org/project/Mastodon.py/) functionalities to connect it to a Django Backend.\n\n\n\n## Set up\n\n\n1. Install from PyPI\n```\npython -m pip install django-toots\n```\n\n2. Add the package to your settings INSTALLED_APPS\n\n```python\n\nINSTALLED_APPS = [\n    ...\n    \"django_toots\",\n    ...\n]\n\n```\n\n\n3. Add the following settings to your Django project.\n\n\nExample:\n\n```python\nimport os\nfrom dotenv import load_dotenv\nload_dotenv()\n\n...\n\n# django-toots \nMASTODON_ACCESS_TOKEN=os.environ.get(\"MASTODON_ACCESS_TOKEN\", \"\") \nMASTODON_API_BASE_URL = \"https://fosstodon.org\"\n\n```\n\n4. Run migrations\n\n```\npython manage.py migrate\n\n```\n\n\n## Usage\n\nTODO: Document this!\n\n\n\n\n### Create a simple toot\n\n```python\n\nfrom django_toots.models import Toot\n\n# create a toot in the db\nt = Toot.objects.create(text=\"Hi, this is my toot using django-toots and Mastodon.py\")\n\n# publish it\nt.publish()\n\n```\n\n\u003c!-- \n### Create a tweet with a media file\n\n```python\nfrom pathlib import Path\nfrom django.core.files.base import ContentFile\nfrom django_tweets.models import Tweet, TweetFile\n\n# create a media file\npath = Path(\"path/to/my/file.jpg\")\n\nwith open(path, \"rb\") as f:\n    f.seek(0)\n    contents = f.read()\n\ntweet_file = TweetFile.objects.create(title=\"nice photo\")\ntweet_file.file.save(path.name, ContentFile(contents))\n# upload to Twitter\ntweet_file = tweet_file.upload()\n\n# create a tweet in the db\ntweet = Tweet.objects.create(text=\"My tweet with a file\")\n\n# add the media file to the tweet object\ntweet.files.add(tweet_file)\n\n# publish it\ntweet.publish()\n\n```\n\n### Usage in the admin\n\n![Django admin](images/admin.png)\n\n* Use [http://127.0.0.1:8000/admin/django_tweets/tweet/](http://127.0.0.1:8000/admin/django_tweets/tweet/) to create a Tweet object\n* Use [http://127.0.0.1:8000/admin/django_tweets/tweetpublication/](http://127.0.0.1:8000/admin/django_tweets/tweetpublication/) to link a Tweet object to publish it.\n\nSimilarly works with the `TweetFile` and `TweetFileUpload` models.\n\n\n\n## About\n\n[🐣 django_tweets](https://twitter.com/django_tweets)\n\n©Django is a registered trademark of the Django Software Foundation.\n--\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framibch%2Fdjango-toots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framibch%2Fdjango-toots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framibch%2Fdjango-toots/lists"}