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

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.6
File Size Uploaded Provenance Actions
django_drf_blog_api-0.3.6.tar.gz 26.7 kB Without provenance Details for django_drf_blog_api-0.3.6.tar.gz

Built distribution (wheel)

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

Total release size: 59.8 kB

Release files / django_drf_blog_api-0.3.6.tar.gz

Download URL django_drf_blog_api-0.3.6.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ba1aef150eb72f931ac253f864a65cd7205113a357dc497d3abbc00677f5ebe7
BLAKE2b-256 checksum
How to use checksums
171b0b72152e0ba264a3aca581b825d8c9441f82a2cf765e7df4ed0c4b211101
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.6-py3-none-any.whl

Download URL django_drf_blog_api-0.3.6-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63c6c57f0bfd5abf3bfd0c6f6b3401387df76810de03b18c389e6f5e56bbb853
BLAKE2b-256 checksum
How to use checksums
77e711bf2eef92950756c56c47fe078ced0b36186ae4c8b9e0e419f21830de36
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.6

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