Skip to main content

Enhanced features for django-blog-lotus: CTAs, cover styling, webhooks, and more

Project description

Django Blog Plus

Enhanced features for django-blog-lotus, providing additional functionality for professional blogging.

Features

  • Call to Action (CTA) Blocks: Create reusable CTA components and assign them to articles
  • Article Cover Styling: Customize cover image backgrounds with preset or custom colors
  • View Tracking: Track article views for popular/trending widgets
  • Webhook API: Create and update articles programmatically via REST API
  • Scheduled Publishing: Automatically publish draft articles at scheduled times
  • RSS/Atom Feeds: Full syndication support with category feeds
  • SEO Enhancements: Sitemaps, reading time, heading optimization
  • Premium Templates: Modern, responsive blog templates

Installation

pip install django-blog-plus

Quick Start

  1. Add to your INSTALLED_APPS:
INSTALLED_APPS = [
    # ...
    'lotus',  # django-blog-lotus
    'django_blog_plus',
    # ...
]
  1. Configure settings (optional):
DJANGO_BLOG_PLUS = {
    'SITE_NAME': 'My Blog',
    'SITE_DESCRIPTION': 'A blog about interesting things',
    'WEBHOOK_SECRET': 'your-secret-key',
    'ARTICLE_PUBLISHED_WEBHOOK_URL': '',  # Optional Zapier/n8n webhook
    'BASE_TEMPLATE': 'base.html',  # Your project's base template
    'DEFAULT_COVER_BG_COLOR': '#f8f9fa',
}
  1. Add URL patterns:
from django.urls import path, include

urlpatterns = [
    # ...
    path('blog/', include('lotus.urls')),
    path('api/blog/', include('django_blog_plus.urls')),
    # ...
]
  1. Run migrations:
python manage.py migrate django_blog_plus
  1. Add context processor (for blog categories in templates):
TEMPLATES = [
    {
        # ...
        'OPTIONS': {
            'context_processors': [
                # ...
                'django_blog_plus.context_processors.blog_categories',
                'django_blog_plus.context_processors.django_blog_plus_config',
            ],
        },
    },
]

Configuration Reference

Setting Default Description
SITE_NAME 'Blog' Site name for RSS feeds
SITE_DESCRIPTION '' Site description for RSS feeds
WEBHOOK_SECRET None Bearer token for webhook API authentication
ARTICLE_PUBLISHED_WEBHOOK_URL '' URL to call when articles are published
BASE_TEMPLATE 'base.html' Base template that blog templates extend
DEFAULT_COVER_BG_COLOR '#f8f9fa' Default background color for article covers
COVER_BG_COLORS (preset list) Available background color choices

Webhook API

Create Article

curl -X POST https://yoursite.com/api/blog/webhook/ \
  -H "Authorization: Bearer YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Article",
    "content": "<h2>Hello</h2><p>World</p>",
    "category_slug": "news",
    "status": "published"
  }'

Update Article

curl -X PATCH https://yoursite.com/api/blog/webhook/update/ \
  -H "Authorization: Bearer YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "article_url": "/blog/2024/01/15/my-article/",
    "title": "Updated Title"
  }'

See /api/blog/webhook/info/ for full API documentation.

Template Tags

{% load django_blog_plus %}

{# Reading time #}
{% reading_time article.content %} min read

{# Previous/Next navigation #}
{% get_adjacent_articles article as nav %}
{% if nav.previous %}Previous: {{ nav.previous.title }}{% endif %}

{# Article CTA #}
{% get_article_cta article.id as cta %}
{% if cta %}{{ cta.title }}{% endif %}

{# Popular articles #}
{% get_popular_articles 5 as popular %}

{# Cover background color #}
{{ article|article_cover_bg }}

Management Commands

# Publish scheduled articles (run via cron)
python manage.py publish_scheduled_articles

# Clean up placeholder images
python manage.py remove_blog_placeholder_images --dry-run

Changelog

See CHANGELOG.md for the full changelog.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_blog_plus-1.0.4.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_blog_plus-1.0.4-py3-none-any.whl (67.1 kB view details)

Uploaded Python 3

File details

Details for the file django_blog_plus-1.0.4.tar.gz.

File metadata

  • Download URL: django_blog_plus-1.0.4.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for django_blog_plus-1.0.4.tar.gz
Algorithm Hash digest
SHA256 61e77e89e7d48be3fc3dcbed07fb4b65161d12a28572cdd6c23810bcb339c0a9
MD5 c9d0d549b31034804adb97acf9c17c1f
BLAKE2b-256 49a12860e2bc1bb79d45f43c638c9a6616398ec51e46a2e0b29a9d62d7b893f3

See more details on using hashes here.

File details

Details for the file django_blog_plus-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_blog_plus-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5de777f221f62efce999f2fd544c4ab2bd36283a528e4c8e9f3831e713e063a
MD5 008d70b8513252b3fd4e04993e02df54
BLAKE2b-256 d16825bce757cf84f9a3026826400c1179d634187b02222dc7910594e0355fbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page