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.5

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.5
File Size Uploaded Provenance Actions
django_drf_blog_api-0.3.5.tar.gz 26.4 kB Without provenance Details for django_drf_blog_api-0.3.5.tar.gz

Built distribution (wheel)

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

Total release size: 59.3 kB

Release files / django_drf_blog_api-0.3.5.tar.gz

Download URL django_drf_blog_api-0.3.5.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b153fe3b844a4f6b031bcfcf08af9d40190a7592b524afb3e9be5ea28a55c9d1
BLAKE2b-256 checksum
How to use checksums
9cde8acbdb1d6d058cb9dee975a1c1dd85d71b888ee16dc267730297cc103b32
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.5-py3-none-any.whl

Download URL django_drf_blog_api-0.3.5-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51ce2421063d38dab1bb61dd2483af3515be71edb3eb209945b580968944b180
BLAKE2b-256 checksum
How to use checksums
2f975ab3799f3d38c77cfa138e9b5104a1a62f9fe4a7d1f76a9768fd4bf9a188
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.5

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