Skip to main content

=================== django-drf-blog-api

A reusable Django REST Framework blog and magazine API package with support for articles, magazine series editions, categories, tags, author profiles, backdated publications (pub_date), comments, likes, Social Media Auto-Posting (Facebook, Instagram, Threads, TikTok, X/Twitter, LinkedIn via django-environ), and Cloudinary / MediaAsset integration.

Current Version: 0.3.2

Quick Start

  1. Installation
.. code-block:: bash

    pip install django-drf-blog-api

2. Configure ``INSTALLED_APPS``

In your Django settings.py:

.. code-block:: python

INSTALLED_APPS = [
    ...,
    'rest_framework',
    'media_library',
    'django_drf_blog_api',
    'django_ckeditor_5',
]
  1. Configure Social Auto-Poster in settings.py
.. code-block:: python

    import environ
    import os

    env = environ.Env()
    environ.Env.read_env(os.path.join(BASE_DIR, '.env'))

    SOCIAL_AUTO_POST = {
        'FRONTEND_SITE_URL': env.str('FRONTEND_SITE_URL', default='https://yourdomain.com'),
        'FACEBOOK': {
            'ENABLED': env.bool('FACEBOOK_AUTO_POST_ENABLED', default=False),
            'PAGE_ID': env.str('FACEBOOK_PAGE_ID', default=''),
            'ACCESS_TOKEN': env.str('FACEBOOK_PAGE_ACCESS_TOKEN', default=''),
        },
        'INSTAGRAM': {
            'ENABLED': env.bool('INSTAGRAM_AUTO_POST_ENABLED', default=False),
            'ACCOUNT_ID': env.str('INSTAGRAM_ACCOUNT_ID', default=''),
            'ACCESS_TOKEN': env.str('INSTAGRAM_ACCESS_TOKEN', default=''),
        },
        'THREADS': {
            'ENABLED': env.bool('THREADS_AUTO_POST_ENABLED', default=False),
            'USER_ID': env.str('THREADS_USER_ID', default=''),
            'ACCESS_TOKEN': env.str('THREADS_ACCESS_TOKEN', default=''),
        },
        'TIKTOK': {
            'ENABLED': env.bool('TIKTOK_AUTO_POST_ENABLED', default=False),
            'ACCOUNT_ID': env.str('TIKTOK_ACCOUNT_ID', default=''),
            'ACCESS_TOKEN': env.str('TIKTOK_ACCESS_TOKEN', default=''),
        },
        'TWITTER': {
            'ENABLED': env.bool('TWITTER_AUTO_POST_ENABLED', default=False),
            'API_KEY': env.str('TWITTER_API_KEY', default=''),
            'API_SECRET': env.str('TWITTER_API_SECRET', default=''),
            'ACCESS_TOKEN': env.str('TWITTER_ACCESS_TOKEN', default=''),
            'ACCESS_TOKEN_SECRET': env.str('TWITTER_ACCESS_TOKEN_SECRET', default=''),
        },
        'LINKEDIN': {
            'ENABLED': env.bool('LINKEDIN_AUTO_POST_ENABLED', default=False),
            'ORGANIZATION_ID': env.str('LINKEDIN_ORGANIZATION_ID', default=''),
            'ACCESS_TOKEN': env.str('LINKEDIN_ACCESS_TOKEN', default=''),
        },
    }

Supported Social Media Platforms
--------------------------------
- **Facebook Pages**: Graph API v19.0 page feed sharing.
- **Instagram Business**: Two-step container creation & publishing (requires image).
- **Threads (Meta)**: Two-step media container & publish API.
- **TikTok**: Content Posting API direct post (requires image or video).
- **X / Twitter**: API v2 ``POST /2/tweets`` via OAuth 1.0a User Context.
- **LinkedIn**: UGC Post API v2.

4. Add URL Patterns
~~~~~~~~~~~~~~~~~~~
In your Django ``urls.py``:

.. code-block:: python

    from django.urls import path, include

    urlpatterns = [
        path('django_drf_blog_api/', include('django_drf_blog_api.urls')),
        path('media-library/', include('media_library.urls')),
    ]

5. Run Migrations
~~~~~~~~~~~~~~~~~
.. code-block:: bash

    python manage.py migrate

Key API Endpoints
-----------------

* **GET /django_drf_blog_api/post-list**: Public blog post list.
* **GET /django_drf_blog_api/post-list/<slug>**: Retrieve blog post by slug.
* **POST /django_drf_blog_api/post**: Create blog post (triggers social auto-posting).
* **GET /django_drf_blog_api/magazines**: List magazine series.
* **POST /django_drf_blog_api/magazines/**: Create magazine series edition.
* **GET /django_drf_blog_api/social-logs**: View social media auto-poster logs.

Metadata

Release files for django-drf-blog-api 0.3.4

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-drf-blog-api 0.3.4
File Size Uploaded Provenance Actions
django_drf_blog_api-0.3.4.tar.gz 25.0 kB Without provenance Details for django_drf_blog_api-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-drf-blog-api 0.3.4
File Interpreter ABI Platform Actions
django_drf_blog_api-0.3.4-py3-none-any.whl Python 3 none any Details for django_drf_blog_api-0.3.4-py3-none-any.whl

Total release size: 56.5 kB

Release files / django_drf_blog_api-0.3.4.tar.gz

Download URL django_drf_blog_api-0.3.4.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9704970a3c314e095af2fefaeb38f8255e4c4004e2b19a6fb50f4893983d9f2d
BLAKE2b-256 checksum
How to use checksums
6c8616d35b0ea0697f5ec7c22c980cee1d267dbfddca80232f08edea745566c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / django_drf_blog_api-0.3.4-py3-none-any.whl

Download URL django_drf_blog_api-0.3.4-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8b07ef3646df986570573ea1213debfdcf04cd367f1d5d025f8d34f0dd4de0c
BLAKE2b-256 checksum
How to use checksums
bdabcac643542f47439d9da2172ef556d2bb5936bcd61c34506f655d7b21b269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for django-drf-blog-api 0.3.4

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