Skip to main content

django-blog-core

CI/CD License: MIT

Reusable multi-blog Django app: Blog, optional Section, and Article with draft / scheduled / published / archived workflow, RSS + Atom feeds, a Pinax-style hookset, secret preview URLs, and optional Markdown / HTML sanitize extras.

Status: 0.1.0 — publish-ready core. Extras [search], [tags], [social], [images] are documented stubs.

Install

pip install django-blog-core
pip install "django-blog-core[markdown]"   # Markdown bodies
pip install "django-blog-core[sanitize]"   # bleach HTML policy
pip install "django-blog-core[all]"        # markdown + sanitize

Quickstart

# settings.py
INSTALLED_APPS = [
    # ...
    "blog_core",
]

BLOG_CORE = {
    "PAGINATE_BY": 12,
    "SANITIZE_HTML": True,
    # "HOOKSET": "myapp.hooks.BlogHookSet",
}
# Or: BLOG_CORE_HOOKSET = "myapp.hooks.BlogHookSet"
# urls.py
from django.urls import include, path

urlpatterns = [
    path("blog/", include("blog_core.urls")),
]
python manage.py migrate
python manage.py publish_scheduled_articles   # cron / host scheduler

Create a Blog and Article in admin. Public list/detail live at /blog/<blog-slug>/ and /blog/<blog-slug>/<article-slug>/. Feeds:

  • /blog/<blog-slug>/feed/rss/
  • /blog/<blog-slug>/feed/atom/

Preview drafts with the secret URL from the admin “Preview” column.

Public visibility

Article.objects.published() (alias public()) is the single source of truth:

state == "published" and publish_at <= now.

Hookset

Subclass blog_core.hookset.DefaultBlogHookSet to customize absolute URLs, who may view non-public articles, body rendering, and feed titles — without forking the package. Hooksets must not widen the public queryset.

HTML / Markdown safety

  • Markdown → HTML via the [markdown] extra.
  • HTML (and Markdown output) is sanitized with bleach when [sanitize] is installed and BLOG_CORE["SANITIZE_HTML"] is true (default).
  • Without bleach, HTML is escaped rather than passed through.
  • Set ALLOW_RAW_HTML = True only if you accept XSS risk. See docs/sanitize.md.

Extras

Extra Purpose
[markdown] Markdown body rendering
[sanitize] bleach allow-list
[search] stub — Haystack/published() index patterns
[tags] stub — tagging integration
[social] stub — share matrix
[images] stub — media attachments

Development

pip install -e ".[testing]"
pytest
# or: tox -e py313-django52

License

MIT — see LICENSE.

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_core-0.1.0.tar.gz (28.5 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_core-0.1.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file django_blog_core-0.1.0.tar.gz.

File metadata

  • Download URL: django_blog_core-0.1.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for django_blog_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 edafe50f4fc0c027bfe9be919d846f3783f5ae5ae5e3574ab4e289e0b2fd616c
MD5 df27a7af37e1e988d2511fc324a75297
BLAKE2b-256 cad8b3bae817233961e3ab203966227a67f7cb7ea3d7e9d464a94faf59232edd

See more details on using hashes here.

File details

Details for the file django_blog_core-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_blog_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69780e86ec4b3f0c4e6d33782fb447ca30a6d5d17ec5df3b8170928ea0546eac
MD5 c33c9cde3f2e459ba5256590afd1abba
BLAKE2b-256 2d97f519e1b2fc652e1fde1084ef2af40499567c6cd162cde214fb5ddfde4c9e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

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