Skip to main content

django-social-autoposter

A standalone, modular Django REST Framework package for broadcasting social media posts, sending direct private messages, and scheduling publications across Facebook Pages & Messenger, Instagram Business & Direct, WhatsApp Business Cloud API, Threads, TikTok, X (Twitter), and LinkedIn with unified logging, generic model linking, and environment-based configuration.

Current Version: 0.8.1

Quick Start

1. Installation

pip install django-social-autoposter

2. Configure INSTALLED_APPS

In your Django settings.py:

INSTALLED_APPS = [
    ...,
    'rest_framework',
    'django_social_autoposter',
]

3. Add URL Patterns

In your Django urls.py:

from django.urls import path, include

urlpatterns = [
    path('social/', include('django_social_autoposter.urls')),
]

4. Run Migrations

python manage.py migrate

Supported Social Media Platforms

  • Facebook Pages & Messenger: Graph API v19.0 feed, Page video, and multi-photo/video carousel posts, plus direct customer messaging.

  • Instagram Business & Direct: Single-image, Reels video, and native multi-slide image/video Carousel publishing (up to 10 slides) and Instagram Direct messaging.

  • WhatsApp Business Cloud API: Meta Graph API direct messaging with support for text, documents, images, audio, video, and templates.

  • Threads (Meta): Two-step media container & publish API (supports text-only, images, videos, and mixed Carousels up to 20 slides).

  • TikTok: Content Posting API direct post (video via PULL_FROM_URL or multi-photo Carousel up to 35 slides).

  • X / Twitter: API v2 POST /2/tweets with chunked image/video media upload and Direct Messaging via OAuth 1.0a / OAuth 2.0 User Context.

  • LinkedIn: UGC Post API v2 (3-step Assets API single/multi-image and video upload) and Member Messaging API v2.

Python Service Usage

from datetime import timedelta
from django.utils import timezone
from django_social_autoposter.services import SocialBroadcastService, SocialMessagingService

# 1. Immediate or Scheduled Broadcast (Single Image or Multi-Image Carousel)
broadcast = SocialBroadcastService.broadcast(
    title="Product Launch",
    message="Check out our new release!",
    link_url="https://example.com/product",
    image_url="https://example.com/image.jpg",
    media_urls=[  # Optional: pass multiple public URLs for native carousels
        "https://example.com/slide1.jpg",
        "https://example.com/slide2.jpg",
    ],
    platforms=['facebook', 'instagram', 'threads', 'tiktok', 'twitter', 'linkedin'],
    scheduled_at=timezone.now() + timedelta(days=1),  # Optional future scheduling
    source_instance=my_instance
)

# 2. Social Direct Messaging (Immediate or Scheduled)
dm = SocialMessagingService.send_message(
    platform='whatsapp',
    recipient_id='+1234567890',
    message='Your order has been verified and processed.',
    media_url='https://example.com/receipt.pdf',
    extra_params={'media_type': 'document'},
    scheduled_at=timezone.now() + timedelta(hours=4)
)

Scheduler Management Command

Run periodically via cron or task runner:

python manage.py process_scheduled_social_posts

Metadata

Release files for django-social-autoposter 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-social-autoposter 0.8.1
File Size Uploaded Provenance Actions
django_social_autoposter-0.8.1.tar.gz 138.0 kB Without provenance Details for django_social_autoposter-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-social-autoposter 0.8.1
File Interpreter ABI Platform Actions
django_social_autoposter-0.8.1-py3-none-any.whl Python 3 none any Details for django_social_autoposter-0.8.1-py3-none-any.whl

Total release size: 310.3 kB

Release files / django_social_autoposter-0.8.1.tar.gz

Download URL django_social_autoposter-0.8.1.tar.gz
Size 138.0 kB
Tags Source
SHA-256 checksum
How to use checksums
00ec1ae4b6f11d0ed6308a8707354ecc51b236ade245a1487932c104f7e52a9f
BLAKE2b-256 checksum
How to use checksums
f63865f0dcc7a66a652f79ffa97548754ea6993aeece22de568978bb9f2620f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / django_social_autoposter-0.8.1-py3-none-any.whl

Download URL django_social_autoposter-0.8.1-py3-none-any.whl
Size 172.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb8923114f10e91aac99ddd0f54ed8b0e103ac00ab47395ab6b27410ec9cb353
BLAKE2b-256 checksum
How to use checksums
315f28746f043b736c13aba8d1939ca0a8c554bd0a476759a5dd6cd3564e6fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for django-social-autoposter 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page