Skip to main content

Django app that serves a parody build artifact as a public book site, with section-level auth gating (public = online-only subset; owner = full book).

Project description

parody-web

A reusable Django app that serves a parody build artifact as a public book site, with section-level auth gating. It's the web surface of the parody ecosystem:

  • parody — core: builds the artifact (and the print/LaTeX side, for now)
  • parody-webthis: renders an artifact as a website
  • (future) parody-print — if/when the LaTeX side is split out of core

You pip install parody-web into a thin per-book Django project; the package is generic, so one codebase serves every book site. Each book differs only by config + content. First site: the partial Real-Time Computing book at rtcbook.org.

Access model

The site imports the full artifact and gates by section: the public sees only online_only sections (the openly-licensed subset); the private parts require login, and only the owner has an account. One deployment serves both the public partial book and — to the owner — the whole thing. (If you'd rather the full text never touch the database, import the partial parody build --online-only artifact instead — then there are no private sections.)

Why a Django app (not a static site)

Parody artifact html is Django-template-flavored — it embeds {% media %}, {% static %}, {% cite %} etc. This app renders it natively through the Django template engine (parody_web.templatetags.parody_web.render_book), so there's no second, lossy tag-resolution renderer to maintain.

Use it in a project

# settings.py
INSTALLED_APPS = [..., "parody_web"]
BOOK_SLUG = "real-time-computing"     # which imported book is the site root
# urls.py
urlpatterns = [path("", include("parody_web.urls")), ...]
pip install parody-web
python manage.py migrate
python manage.py createsuperuser                       # the owner (only account)
python manage.py import_artifact rtc.json --slug real-time-computing

Provides: Book/Chapter/Section models, the import_artifact command (upsert-by-slug, idempotent), index + section views, templates (override them in your project), and the rendering template tags. Reads settings.BOOK_SLUG, MEDIA_URL, LOGIN_URL.

A ready-to-copy thin project — settings, urls, Procfile, and AWS/SSM deploy glue — lives in example_site/; generate a new book site from it.

Develop

pip install -e .
python runtests.py            # standalone test suite (tests/settings.py)

Deploy

AWS via SSM + GitHub Actions, designed for reuse across book projects: each book site is a small repo (copied from example_site/) that pins this package and calls the shared reusable workflow (deploy-reusable.yml) — improve the renderer or the deploy once, every site picks it up. Runbook: example_site/deploy/AWS.md.

Status

0.x — interfaces may change. Renders the rtc artifact end to end with section-level auth gating; 9 tests. {% cite %} currently renders [key] (wire citeproc/a .bib for full citations). Not yet published to PyPI or deployed to rtcbook.org (owner steps).

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

parody_web-0.1.4.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

parody_web-0.1.4-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file parody_web-0.1.4.tar.gz.

File metadata

  • Download URL: parody_web-0.1.4.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for parody_web-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0ab2b38bd7e7f8498d8216230ea9fc147069d04de5918d8024400ab84dfaceda
MD5 8cc29760663402298e3fa2d8f8edc1e4
BLAKE2b-256 2d9e3be90cd20f78f5a9783471edc8f9cbc2250c70492dfc89ef71a359640d4b

See more details on using hashes here.

File details

Details for the file parody_web-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: parody_web-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for parody_web-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d0554515cd6c6a48d7654db7b931538ce7afd0359166c03953c56b3b9126abb4
MD5 5c6d7fb4b46c28567e8223b1ab5d5ace
BLAKE2b-256 91685c1364af0e51040eb5f0db2fb60b9a7569e8ab4dff2405f811c198c1d5a9

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