######## Settings ######## Documentation of all the configuration variables you can add to your ``DJANGO_SETTINGS_MODULE`` file, plus system checks for the runtime seams that apply those settings safely. ************* System checks ************* Run ``python manage.py check`` during deployment. The ``cast.E010`` error means django-cast could not install its guarded Wagtail publication hook; publication rules such as the episode audio requirement are not safely enforced until the deployment uses a supported Wagtail version and the startup warning is resolved. ``cast.E012`` means ``CAST_VOXHELM_API_BASE`` is not an absolute ``http(s)`` URL or contains user info, a query string or a fragment. ******** Comments ******** .. _cast_comments_enabled: CAST_COMMENTS_ENABLED ===================== Whether or not to enable comments on the site. Defaults to ``False``. CAST_COMMENTS_EXCLUDE_FIELDS ============================ Tuple of comment model field names to hide from the public comment form. Defaults to an empty tuple ``()``. Existing deployments that still define ``FLUENT_COMMENTS_EXCLUDE_FIELDS`` are supported as a legacy fallback when the ``CAST_*`` setting is not present. CAST_COMMENTS_DEFAULT_MODERATOR =============================== Dotted path to the moderator class used by the comments app. Defaults to ``"cast.moderation.Moderator"``. Existing deployments that still define ``FLUENT_COMMENTS_DEFAULT_MODERATOR`` are supported as a legacy fallback when the ``CAST_*`` setting is not present. CAST_COMMENTS_FORM_CSS_CLASS ============================ CSS classes applied to the rendered comment form wrapper. Defaults to ``"comments-form form-horizontal"``. CAST_COMMENTS_LABEL_CSS_CLASS ============================= CSS classes applied to comment form labels. Defaults to ``"col-sm-2"``. CAST_COMMENTS_FIELD_CSS_CLASS ============================= CSS classes applied to comment form field containers. Defaults to ``"col-sm-10"``. .. _cast_comments_allow_author_edits: CAST_COMMENTS_ALLOW_AUTHOR_EDITS ================================ Whether to let an anonymous author edit or delete their own comment from the same browser. Defaults to ``False`` (opt-in). Set to the literal ``True`` to enable it — a string such as ``"False"`` does not turn it on. Requires a **server-side session backend**: the ``signed_cookies`` ``SESSION_ENGINE`` is rejected by the cast system checks (``cast.E006``), because comment ownership is tracked in the session and a client-carried list cannot be revoked. See :ref:`comments_author_edits` for the full behaviour and privacy notes. .. _cast_comments_author_edit_window: CAST_COMMENTS_AUTHOR_EDIT_WINDOW ================================ Optional hard time window, in integer seconds, for author edit/delete actions. Defaults to ``0``, which means there is no additional hard time cap beyond the same-browser session, reply, visibility, and rate-limit rules. A positive value applies to both edit and delete, counted from the comment's submission time. Only relevant when :ref:`CAST_COMMENTS_ALLOW_AUTHOR_EDITS ` is enabled. The value must be a non-negative integer; invalid values are reported by the cast system checks as ``cast.E007``. .. _cast_comments_owned_ids_cap: CAST_COMMENTS_OWNED_IDS_CAP =========================== The maximum number of owned comment ids tracked in a single session. Older entries are dropped once the cap is reached. Defaults to ``200``; ``0`` means **no cap** (every id is kept). Only relevant when :ref:`CAST_COMMENTS_ALLOW_AUTHOR_EDITS ` is enabled. .. _cast_comments_edit_rate_limit: CAST_COMMENTS_EDIT_RATE_LIMIT ============================= The maximum number of author edit/delete actions allowed per session within ``CAST_COMMENTS_EDIT_RATE_WINDOW`` seconds. Defaults to ``30``; ``0`` **disables** rate limiting. Only relevant when :ref:`CAST_COMMENTS_ALLOW_AUTHOR_EDITS ` is enabled. .. _cast_comments_edit_rate_window: CAST_COMMENTS_EDIT_RATE_WINDOW ============================== The length, in seconds, of the rate-limit window used by ``CAST_COMMENTS_EDIT_RATE_LIMIT``. Defaults to ``60`` and must be a positive integer. Only relevant when :ref:`CAST_COMMENTS_ALLOW_AUTHOR_EDITS ` is enabled. .. _cast_comments_post_rate_limit: CAST_COMMENTS_POST_RATE_LIMIT ============================= The maximum number of comments one client may post within ``CAST_COMMENTS_POST_RATE_WINDOW`` seconds, over both comment post views. Defaults to ``20``; ``0`` **disables** the limit. Logged-in users are counted per user, anonymous visitors per client address. Further posts are answered with ``429 Too Many Requests`` and a ``Retry-After`` header until earlier posts leave the window. Previews are not counted. The client address is determined by Django REST framework: behind a reverse proxy set ``REST_FRAMEWORK["NUM_PROXIES"]`` to the number of trusted proxies, otherwise all visitors may share one budget or a client can pick its own address through ``X-Forwarded-For``. Counters live in the ``default`` cache, which has to be shared by all worker processes for the limit to hold across them. .. _cast_comments_post_rate_window: CAST_COMMENTS_POST_RATE_WINDOW ============================== The length, in seconds, of the sliding window used by ``CAST_COMMENTS_POST_RATE_LIMIT``. Defaults to ``600`` and must be a positive integer. ********** Pagination ********** POST_LIST_PAGINATION ==================== The number of posts to show per page on the user facing blog list page. Defaults to ``5``. CHOOSER_PAGINATION ================== The number of items (audio, video or image) to show per page in the wagtail admin chooser. Defaults to ``10``. MENU_ITEM_PAGINATION ==================== The number of items (audio, video, or image) to show per page in the wagtail admin menu. Defaults to ``20``. ****** Images ****** DELETE_WAGTAIL_IMAGES ===================== Whether or not to delete the original image when a Wagtail image model is removed. Defaults to ``True``. This is useful if you are using an object store like S3 to store your images and want to avoid having your production images deleted when you try out stuff in your development environment. CAST_IMAGE_FORMATS ================== For which image formats to generate thumbnails / srcset / source renditions. Defaults to ``["jpeg", "avif"]``. .. _image_slot_dimensions: CAST_REGULAR_IMAGE_SLOT_DIMENSIONS =================================== The dimensions of the image slots used for regular (non-gallery) images in blog posts. Each entry is a ``(width, height)`` tuple. Defaults to ``[(1110, 740)]``. .. code-block:: python CAST_REGULAR_IMAGE_SLOT_DIMENSIONS = [(1110, 740)] CAST_GALLERY_IMAGE_SLOT_DIMENSIONS ==================================== The dimensions of image slots used for gallery images. The first entry is the modal (full-size) slot, and the second is the thumbnail slot. Defaults to ``[(1110, 740), (120, 80)]``. .. code-block:: python CAST_GALLERY_IMAGE_SLOT_DIMENSIONS = [(1110, 740), (120, 80)] CAST_GALLERY_THUMBNAIL_RENDITIONS_SRGB ======================================= Whether gallery thumbnail renditions should normalize embedded ICC profiles to compact sRGB profiles. Defaults to ``True``. Only the thumbnail slot (the second entry in ``CAST_GALLERY_IMAGE_SLOT_DIMENSIONS``) is affected; modal/full-size gallery renditions and regular image renditions preserve their existing color handling. .. code-block:: python CAST_GALLERY_THUMBNAIL_RENDITIONS_SRGB = True Changing this setting changes the generated Wagtail rendition filter specs. Run ``sync_renditions`` once after deployment to create the new renditions and remove the matching previous/next thumbnail color-profile rendition records/files safely. Until that synchronization completes, gallery rendering uses an existing counterpart rendition so thumbnails remain visible. CAST_GALLERY_TOKEN_MAX_AGE ========================== Lifetime, in seconds, of the signed gallery token that rendered galleries pass to the gallery modal view. Defaults to ``86400`` (one day). Older tokens are rejected (the modal request returns ``400``), so a page left open longer than this must be reloaded before the modal opens again. Raise it if rendered pages are cached for longer than a day. SVG uploads =========== Wagtail image uploads in SVG format are always rejected with a validation error, even if ``WAGTAILIMAGES_EXTENSIONS`` includes ``svg``: SVG is active content and would be stored unsanitized at a media URL. **************** Post Body Blocks **************** CAST_POST_BODY_BLOCKS ===================== Custom Wagtail ``Post.body`` blocks to append to the built-in block list. Defaults to unset/``None``, which means only the built-in blocks are available. The setting must be a dict with optional ``"overview"`` and ``"detail"`` keys; each value is a list or tuple of dotted no-argument factory paths. Each factory must return ``(name, block)`` where ``name`` is a new, non-empty block name and ``block`` is a ``wagtail.blocks.Block`` instance; names must not duplicate each other or the built-in block names. .. code-block:: python CAST_POST_BODY_BLOCKS = { "overview": ["myapp.blocks.teaser_block"], "detail": ["myapp.blocks.callout_block"], } CAST_CODE_BLOCK_MAX_SOURCE_LENGTH ================================= Maximum number of characters in a ``code`` block's source. Defaults to ``32768``. Longer sources are rejected when saving in Wagtail or through the editor API (``too_long``). Sources stored before the limit existed still render, escaped as plain text without syntax highlighting. CAST_CODE_BLOCK_LANGUAGES ========================= Pygments lexer aliases that ``code`` blocks may highlight. Defaults to a curated list of common languages (for example ``python``, ``javascript``, ``bash``, ``html``, ``css``, ``json``, ``yaml``, ``sql``, ``rust``, ``go``). Any other language renders as plain text. Highlighted HTML is cached by content hash in the default Django cache and pre-rendered when a block is saved in Wagtail, so public page and feed renders rarely run Pygments. .. code-block:: python CAST_CODE_BLOCK_LANGUAGES = ["python", "elixir", "text"] Configured blocks are also available to the editor API for their configured section. Editor API clients send custom block values in the block's author-facing JSON shape; they do not send Wagtail's internal ``ListBlock`` item wrappers. Custom blocks that reference images, pages, snippets, or media are responsible for their own validation and permission semantics. ********** Images API ********** .. _cast_public_images_api: CAST_PUBLIC_IMAGES_API ====================== Defaults to ``False``. The Wagtail images API at ``/api/wagtail/images/`` then only answers active staff users, because it lists original uploads (including images only used by drafts) with download URLs to the unprocessed originals. Set it to ``True`` to let anonymous callers list and fetch images again, as in releases before 0.2.67. Either way, images in view-restricted collections are only listed for callers who pass the collection's restriction. .. code-block:: python CAST_PUBLIC_IMAGES_API = True ************* Transcription ************* CAST_VOXHELM_API_BASE ===================== Base URL for the Voxhelm service used by ``generate_transcripts`` and the Wagtail admin transcript workflow. The value may point at either the service root (for example ``https://voxhelm.example.com``) or the ``/v1`` API prefix. This is **deployment configuration only**: set it as a Django setting or an environment variable. It is not editable in Wagtail admin (a site-level base URL let holders of the delegable settings permission aim server-side requests at arbitrary internal hosts). The value must be an absolute ``http://`` or ``https://`` URL with a host and must not contain user info, a query string or a fragment; ``python manage.py check`` reports ``cast.E012`` for an invalid value and the Voxhelm client refuses to use it. Between the Django-settings and environment levels the base URL and ``CAST_VOXHELM_API_KEY`` still resolve as a pair: a nonempty Django credential selects the Django pair, otherwise the environment pair is used, and an incomplete pair disables generation rather than inheriting a credential. A token stored in ``Settings -> Voxhelm settings`` overrides only the key. CAST_VOXHELM_API_KEY ==================== Bearer token used for Voxhelm job submission, polling, and artifact download. This can be set as either a Django setting or an environment variable, or per site through the Wagtail admin ``Settings -> Voxhelm settings`` screen. A site token overrides the deployment key and is sent to the deployment ``CAST_VOXHELM_API_BASE``; tick "Remove stored API token" there to fall back to the deployment key. CAST_VOXHELM_MODEL ================== Optional Voxhelm batch model value for transcript generation. Defaults to ``"auto"``. This can also be managed per site in Wagtail admin. CAST_VOXHELM_LANGUAGE ===================== Optional language hint passed through to Voxhelm batch jobs. By default no language hint is sent. This can also be managed per site in Wagtail admin. CAST_VOXHELM_DIARIZATION_ENABLED ================================ Whether to request generic speaker diarization for Voxhelm transcript jobs. Defaults to ``False``. When enabled, django-cast sends ``{"diarization": {"enabled": True}}`` in the top-level Voxhelm job payload; when disabled or unset, the field is omitted and existing transcription behavior is unchanged. This can be set as a Django setting or environment variable. Common boolean strings such as ``1``, ``true``, ``yes``, and ``on`` enable diarization; ``0``, ``false``, ``no``, and ``off`` disable it. The Wagtail admin ``Settings -> Voxhelm settings`` screen also exposes a site-level value with three states: "Not set here" (the stored value is empty and the Django/environment configuration applies), "Enabled for this site", or "Disabled for this site". Only the two explicit choices override the Django/environment value; an explicit site-level disabled value overrides a global enabled value. The field's help text shows the value it currently resolves to and where it comes from (this site setting, the Django setting, the environment variable, or the built-in default), and the editor API transcript status (``GET /api/editor/episodes/{id}/transcript/``) reports the same ``source``. If diarization is unexpectedly off while the environment says ``true``, check for an explicit "Disabled for this site" value there. The Voxhelm deployment must have its diarization backend configured before this setting is enabled. Diarization can make full-episode transcription slower, so production sites should use the queued transcript worker flow rather than expecting a web request to wait for completion. Individual audio objects can override this generation default with their ``transcript_diarization_mode`` field. ``inherit`` uses the setting documented here, ``enabled`` requests diarization even when this setting is false, and ``disabled`` omits both the diarization payload and speaker-count hint for that audio. The audio-level disabled mode also hides stored speaker labels from public transcript output without rewriting the stored transcript files. CAST_VOXHELM_KNOWN_SPEAKER_ENABLED ================================== Whether to send approved contributor voice references to Voxhelm as known-speaker reference material for diarized transcript jobs. Defaults to ``False``. When enabled, a diarized job for an episode also sends the approved voice references of that episode's expected contributors (source ranges into existing audio, or uploaded clips only when protected storage provides an absolute temporary URL), never public profile URLs. Hidden contributors are excluded unless a reference explicitly opts in. This can be set as a Django setting or environment variable, using the same boolean strings as ``CAST_VOXHELM_DIARIZATION_ENABLED``. The Wagtail admin ``Settings -> Voxhelm settings`` screen also exposes the same three-state site-level value as diarization, with the same effective-value help text. Known-speaker recognition requires diarization for the job and applies to episode-level generation. A job that sends voice references omits the speaker-count hint: a fixed count made pyannote merge two similar voices, such as a guest and a host, into one label. Diarized jobs without voice references still send the episode's contributor count. Voxhelm-returned results are stored as private, reviewable per-segment suggestions and are not shown publicly until an editor reviews and approves them. CAST_VOXHELM_POLL_INTERVAL ========================== Polling interval in seconds for ``generate_transcripts`` while waiting for a Voxhelm batch job to finish. Defaults to ``2.0`` seconds. Polling, job and request durations (including direct ``VoxhelmClient`` arguments) must be finite numbers greater than zero and at most 86400 seconds. Fractional seconds are supported; booleans and invalid durations raise a configuration error before any network work. Existing consumers using zero to busy-poll must select a positive interval. CAST_VOXHELM_POLL_TIMEOUT ========================= Maximum time in seconds to wait for a Voxhelm batch job before the command fails. Defaults to ``900.0`` seconds. One monotonic deadline covers each polling exchange, including DNS, headers and response reads. Late terminal results are refused and sleeps use only the remaining budget. At most four polling exchanges may remain in flight per process; a stalled exchange retains its slot until it exits. Capacity exhaustion is retried within the remaining job budget. Timed-out read-only exchanges may finish in the background but cannot publish results. A status poll that cannot reach Voxhelm or loses the connection before the answer (refused, reset or timed-out connections, an empty, cut-off or unreadable JSON response) is logged as a warning on ``cast.voxhelm.client`` and repeated after ``CAST_VOXHELM_POLL_INTERVAL`` until this deadline, so a short outage such as a proxy restart does not abort the wait. HTTP error statuses are not repeated. Job submission is never repeated, because a lost answer to it can still have created the job. If waiting fails after submission, the error names the Voxhelm job so its result can be completed without submitting the audio again. CAST_VOXHELM_REQUEST_TIMEOUT ============================ Per-request HTTP timeout in seconds for Voxhelm API calls and artifact downloads. Defaults to ``30.0`` seconds. This is separate from ``CAST_VOXHELM_POLL_TIMEOUT``, which controls the overall job wait deadline. CAST_VOXHELM_STALE_AFTER ======================== Age in seconds after which a queued or running Wagtail-admin transcript generation counts as interrupted. Running generations are measured from when the completion task started, queued ones from their last update. Defaults to ``CAST_VOXHELM_POLL_TIMEOUT`` plus 15 minutes. A worker restart (deploy, backup, restore, or a ``SIGKILL`` after the stop timeout) can end the completion task before it records a result. Once a generation is older than this threshold, the admin shows "Transcript generation was interrupted" and the Generate control is enabled again. Generating again resumes completing the interrupted Voxhelm job instead of submitting a new one, so a job Voxhelm already finished is picked up without transcribing the audio a second time. If that job failed on the Voxhelm side, the generation is marked failed and the next Generate submits a fresh job. Keep the value above the poll timeout so a task that is still waiting on Voxhelm is not treated as interrupted. Wagtail Admin Configuration =========================== django-cast also exposes a site-scoped ``Voxhelm settings`` model in Wagtail admin for the API token, optional model/language preferences, and optional diarization override (the API base URL is deployment-only, see ``CAST_VOXHELM_API_BASE``). These values take precedence over Django settings and environment variables for Wagtail-admin-triggered transcript generation on that site; the diarization and known-speaker fields can also be left at "Not set here" to inherit the Django/environment value. Wagtail-admin-triggered transcript completion is queued through Django Tasks. Production sites that need a database-backed transcript worker should install the optional ``transcript-worker`` extra. That extra requires a Wagtail/django-tasks combination compatible with ``django-tasks-db`` 0.12; Wagtail 7.0 LTS uses ``django-tasks`` 0.7 and is not compatible with that database backend. Keep the global ``default`` backend immediate, and route ``cast_transcripts`` to the database backend: .. code-block:: bash uv pip install "django-cast[transcript-worker]" .. code-block:: python INSTALLED_APPS += ["django_tasks_db"] TASKS = { "default": { "BACKEND": "django_tasks.backends.immediate.ImmediateBackend", }, "cast_transcripts": { "BACKEND": "django_tasks_db.DatabaseBackend", }, } Run a database worker for that backend, using a stable worker id per deployed site: .. code-block:: bash python manage.py db_worker --backend cast_transcripts --worker-id homepage-transcripts ********* Templates ********* CAST_CUSTOM_THEMES ================== To configure custom themes for the site, use the ``CAST_CUSTOM_THEMES`` setting. By default, it is set to an empty list ``[]``. Each theme requires two elements: a name and a display. For instance: .. code-block:: python CAST_CUSTOM_THEMES = [ # (name, display) ("my_theme", "My Theme"), ("my_other_theme", "My Other Theme"), ] The display value is the title displayed in the theme selector within the Wagtail admin panel. The name corresponds to the theme's base directory inside your templates folder. To create a theme named my_theme, make a directory called ``cast/my_theme`` within your templates folder and place your templates inside. CAST_FOLLOW_LINKS ================= Optional mapping of follow links shown in the navbar. Defaults to an empty mapping ``{}``. Supported keys are ``rss``, ``mastodon``, ``github``, ``bluesky``, ``linkedin``, ``email``, and ``apple_podcasts``. When a blog context is available, the ``rss`` value is always set to the blog-specific XML feed URL, overriding any value from settings. A ``feed_detail`` key is also auto-generated, pointing to the human-readable feed detail page at ``/feed/``. The navbar RSS icon links to ``feed_detail`` when available, falling back to ``rss``. The settings ``rss`` value is only used as a fallback on pages without a blog context. If ``email`` is not provided, it falls back to ``Blog.email`` when available. Unlike ``rss``, a settings-level ``email`` value takes precedence over ``Blog.email``. The ``apple_podcasts`` key is used on the feed detail page to show a subscribe link to Apple Podcasts. .. code-block:: python CAST_FOLLOW_LINKS = { # "rss" and "feed_detail" are auto-generated when a blog is present "apple_podcasts": "https://podcasts.apple.com/podcast/your-podcast/id123", "mastodon": "https://example.social/@account", "github": "https://github.com/example", "bluesky": "https://bsky.app/profile/example.com", "linkedin": "https://www.linkedin.com/in/example/", "email": "mailto:hello@example.com", } CAST_AUDIO_PLAYER ================= Audio player implementation used when rendering audio blocks. Defaults to ``"podlove"``. Valid values are ``"podlove"`` for the Podlove Web Player and ``"custom"`` for django-cast's dependency-free custom web-component player. When ``"custom"`` is selected, themes should load the custom player asset and use the ``use_custom_audio_player`` context flag; Podlove theme overrides are only used by the Podlove player. CAST_PODLOVE_PLAYER_THEMES ========================== Optional overrides for the Podlove Web Player theme config returned by ``/api/audios/player_config/``. Defaults to an empty mapping ``{}``. The setting is a mapping keyed by template base directory name (or ``default``). Each entry can define a shared ``tokens``/``fonts`` override or per-scheme overrides under ``light`` and ``dark``. .. code-block:: python CAST_PODLOVE_PLAYER_THEMES = { "bootstrap5": { "light": { "tokens": { "brand": "#d97706", }, }, "dark": { "tokens": { "brand": "#fbbf24", }, }, }, "default": { "tokens": { "brand": "#ff0000", }, }, } CAST_ENABLE_DEV_TOOLS ===================== Whether to enable dev-only cast views. Defaults to ``False``. When enabled, these routes are accessible: - ``/cast/styleguide/`` - ``/cast/components/`` - ``/cast/theme-compare/`` - ``/cast/dev-health/`` When disabled, these routes return ``404``. ``/cast/styleguide/`` creates seed pages and media on every visit, so even when enabled it requires a logged-in, active staff user (anonymous visitors are redirected to the Wagtail login, other users get ``403``). CAST_ENABLE_STYLEGUIDE ====================== Deprecated alias for ``CAST_ENABLE_DEV_TOOLS``. Precedence: - If only ``CAST_ENABLE_STYLEGUIDE`` is set: use its value and emit ``DeprecationWarning``. - If only ``CAST_ENABLE_DEV_TOOLS`` is set: use its value. - If both are set: ``CAST_ENABLE_DEV_TOOLS`` wins and a ``DeprecationWarning`` is emitted. - If neither is set: default ``False``. .. note:: To fully silence the deprecation warning, remove ``CAST_ENABLE_STYLEGUIDE`` from settings instead of setting it to ``False``. CAST_STYLEGUIDE_REMOTE_MEDIA ============================ When enabled, the styleguide can fetch real-world media (images, audio, transcripts) from configured source URLs. Defaults to ``False``. This is intended for local development only. CAST_STYLEGUIDE_IMAGE_SOURCE_URLS ================================= Page URL or list/tuple of page URLs the styleguide can scrape for gallery images when ``CAST_STYLEGUIDE_REMOTE_MEDIA`` is enabled. Defaults to an empty list ``[]`` when unset. CAST_STYLEGUIDE_VIDEO_SOURCE_URL ================================ Page URL the styleguide can scrape for a video source when remote media is enabled. Defaults to ``None``. CAST_STYLEGUIDE_PODCAST_SOURCE_URL ================================== Episode detail URL the styleguide can scrape to locate audio and Podlove player data when remote media is enabled. Defaults to ``None``. CAST_STYLEGUIDE_TRANSCRIPT_SOURCE_URL ===================================== Transcript page URL the styleguide can scrape for transcript segments when remote media is enabled. Defaults to ``None``. CAST_STYLEGUIDE_REMOTE_TIMEOUT ============================== Network timeout, in seconds, for styleguide remote-media fetches. Defaults to ``8``. CAST_STYLEGUIDE_IMAGE_LIMIT =========================== Maximum number of remote gallery images the styleguide imports from scraped pages. Defaults to ``6``. CAST_STYLEGUIDE_GENERATE_RENDITIONS =================================== Whether the styleguide should generate missing image renditions while building styleguide galleries. Defaults to ``False``. CAST_STYLEGUIDE_GALLERY_CHUNK_SIZE ================================== Number of imported remote gallery images grouped into each generated styleguide gallery. Defaults to ``6``. CAST_STYLEGUIDE_BODY_GALLERY_LIMIT ================================== Maximum number of generated gallery blocks inserted into styleguide body content. Defaults to ``1``. CAST_STYLEGUIDE_TRANSCRIPT_MAX_SEGMENTS ======================================= Maximum number of transcript segments retained from a fetched Podlove payload for styleguide seed data. Defaults to ``12``. CAST_STYLEGUIDE_TRANSCRIPT_EXCERPT_SEGMENTS =========================================== Maximum number of transcript segments shown in the styleguide audio preview. Defaults to ``2``. ******** Storages ******** Configure Backup Storage ======================== If you store your media files on S3, you can configure a local backup storage like this: .. code-block:: python STORAGES = { "default": {"BACKEND": "config.settings.local.CustomS3Boto3Storage"}, "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}, "production": {"BACKEND": "config.settings.local.CustomS3Boto3Storage"}, "backup": { "BACKEND": "django.core.files.storage.FileSystemStorage", "OPTIONS": { "location": ROOT_DIR.path("backups").path("media"), }, }, "cast_private_media": { "BACKEND": "django.core.files.storage.FileSystemStorage", "OPTIONS": { "location": ROOT_DIR.path("private").path("media"), "base_url": None, }, }, "cast_public_transcripts": { "BACKEND": "config.settings.local.CustomS3Boto3Storage", }, } ``cast_public_transcripts`` stores public transcript artifacts (``Transcript.podlove``, ``Transcript.vtt``, and ``Transcript.dote``). These files are publishable output used by public transcript pages, feeds, podcast clients, and the custom audio player. If the alias is omitted, django-cast uses ``cast_private_media`` when that alias is explicitly configured, preserving sites that already adapted to the temporary private-storage behavior. If both aliases are omitted, transcript artifacts use Django's default storage, matching the original public-media behavior. ``cast_private_media`` stores private django-cast artifacts outside public media. If omitted, django-cast falls back to ``CAST_PRIVATE_MEDIA_ROOT`` or a local ``cast-private-media`` directory next to ``MEDIA_ROOT``. Uploaded contributor voice-reference clips, the private ``Transcript.speakers`` known-speaker sidecar and the private ``Transcript.corrections`` glossary sidecar use ``STORAGES["cast_voice_references"]`` when configured. If that dedicated alias is omitted, they fall back to ``cast_private_media`` or the same non-public local private-media fallback. CAST_PRIVATE_MEDIA_ROOT ======================= Filesystem root used by the fallback private media storage when the ``cast_private_media`` storage alias is not configured. Defaults to an empty string ``""``; with that default, django-cast uses a local ``cast-private-media`` directory next to ``MEDIA_ROOT``. CAST_AUDIO_UPLOAD_MAX_BYTES =========================== Maximum accepted size, in bytes, for each uploaded audio file before django-cast validates the file container or runs ffprobe. Defaults to ``536870912`` (512 MiB). CAST_VIDEO_UPLOAD_MAX_BYTES =========================== Maximum accepted size, in bytes, for each uploaded video file before django-cast validates the file container or runs ffmpeg/ffprobe. Defaults to ``2147483648`` (2 GiB). CAST_TRANSCRIPT_UPLOAD_MAX_BYTES ================================ Maximum accepted size, in bytes, for each uploaded Podlove JSON, DOTe JSON, or WebVTT transcript before parsing. Defaults to ``10485760`` (10 MiB). The limit is enforced from the uploaded content rather than a client-reported size. CAST_FILE_EXTENSIONS ==================== File extensions accepted for the generic ``File`` model (Django admin ``Files``, stored under ``cast_files/``). Defaults to documents and archives only: ``csv``, ``docx``, ``epub``, ``gz``, ``json``, ``md``, ``odp``, ``ods``, ``odt``, ``pdf``, ``pptx``, ``tar``, ``tgz``, ``txt``, ``xlsx`` and ``zip``. Never add active content such as ``html``, ``svg``, ``xml`` or ``js``. django-cast does not serve these files itself; configure the media server or object storage to send ``X-Content-Type-Options: nosniff`` and ``Content-Disposition: attachment`` for ``cast_files/`` (see the deployment guide). CAST_EDITOR_MEDIA_UPLOAD_LOCK_SECONDS ===================================== Time-to-live, in seconds, for the shared editor API, legacy ``/api/upload_video/``, and Wagtail admin per-user audio/video upload lock. Defaults to ``7200`` (2 hours). The lock is stored in Django's default cache and remains until expiry because Django has no portable atomic owner-checked release. Multi-worker deployments need a shared cache backend, such as Redis or Memcached; Django's ``LocMemCache`` only coordinates within one process. Upload leases intentionally remain after completion or failure. With the default ``CAST_EDITOR_MEDIA_UPLOAD_LOCK_SECONDS = 7200``, the same user must wait up to two hours before another audio/video upload, including a retry. Choose a shorter finite lease if that admission interval is unsuitable; an operation exceeding the lease can overlap a later upload. Use a shared cache across workers. CAST_EDITOR_MEDIA_PROBE_SECONDS =============================== Cumulative synchronous ffprobe/ffmpeg budget, in seconds, for one editor API or legacy ``/api/upload_video/`` audio/video upload after the file has been received. Defaults to ``10``. Required audio duration probing failures are returned as ``probe_timeout`` or ``probe_failed``; optional audio chapter extraction and video poster generation degrade without failing the upload. CAST_MEDIA_PROBE_SECONDS ======================== Cumulative synchronous ffprobe/ffmpeg budget, in seconds, for one Wagtail admin audio or video upload. Defaults to ``30``. Integer and floating-point values are accepted. Required audio duration probing fails the upload when the budget is exhausted; optional derivation work degrades without failing it. CAST_EDITOR_SCOPES ================== Mapping from editor API permission buckets to OAuth/IndieAuth scope strings. Defaults to one write bucket accepting ``"write"``, ``"create"``, or ``"update"``, one publish bucket accepting ``"publish"``, and one delete bucket accepting ``"delete"``. django-cast does not split create and update internally, so the standard IndieAuth ``create`` and ``update`` scopes both satisfy the write requirement; ``media`` and other issuer-specific aliases are intentionally not bundled and can be mapped here by the site. .. code-block:: python CAST_EDITOR_SCOPES = { "write": {"write", "create", "update", "posts:write"}, "publish": {"publish", "posts:publish"}, "delete": {"delete", "media:delete"}, } Overrides replace the complete mapping. Sites that set ``CAST_EDITOR_SCOPES`` must add a ``delete`` bucket before using scoped tokens with legacy audio/video deletion. A missing bucket fails closed with ``403 Forbidden``. ****************** Faceted Navigation ****************** CAST_FILTERSET_FACETS ===================== Controls which ``PostFilterset`` fields are active for blog list filtering. Default: .. code-block:: python CAST_FILTERSET_FACETS = [ "search", "date", "date_facets", "category_facets", "tag_facets", "o" ] Supported values: - ``search``: full-text search - ``date``: date range filter (``date_after`` / ``date_before``) - ``date_facets``: month facet (``YYYY-MM``) - ``category_facets``: category slug facet - ``tag_facets``: tag slug facet - ``o``: ordering (``visible_date`` / ``-visible_date``) Example removing tag facets: .. code-block:: python CAST_FILTERSET_FACETS = [ "search", "date", "date_facets", "category_facets", "o" ] Modal workflow behavior ~~~~~~~~~~~~~~~~~~~~~~~ ``/api/facet_counts//?mode=modal`` only emits modal groups for facet names that are both: - configured in ``CAST_FILTERSET_FACETS`` - one of ``date_facets``, ``tag_facets``, ``category_facets`` Practical recommendations: - Keep ``search`` enabled so modal counts can track the current query text. - Keep ``o`` enabled if your UI exposes ordering controls. - ``date`` (range filter) affects the blog list page, but the ``?mode=modal`` facet API does not currently apply date-range constraints when computing its counts. ********** Repository ********** CAST_REPOSITORY =============== How the blog index and feeds fetch their data. Both values use the Django ORM. Defaults to ``"default"``, which collects the query results into a JSON-serializable dictionary and rebuilds the page context from it in the same request. No cache sits between the two steps. Set ``CAST_REPOSITORY`` to ``"django"`` to build the context from Django models directly. .. code-block:: python CAST_REPOSITORY = "django" ***** Feeds ***** CAST_FEED_ITUNES_SUMMARY ======================== Whether podcast feeds emit ```` for the podcast and each episode. Defaults to ``True``. The element repeats the ```` content, so it can make up a large share of a feed with long show notes. Apple Podcasts reads ````; set this to ``False`` to shrink the feed when your clients do not need the duplicate. .. code-block:: python CAST_FEED_ITUNES_SUMMARY = False CAST_BLOG_FEED_ITEM_LIMIT ========================= Maximum number of entries in the blog RSS and Atom feeds. Defaults to ``None``, which includes every live, public post. Set a positive integer to keep only the newest posts; the ``cast.E011`` system check rejects other values. Podcast feeds are not affected and always include every episode. .. code-block:: python CAST_BLOG_FEED_ITEM_LIMIT = 50 ************* Media cleanup ************* CAST_MEDIA_STALE_MIN_AGE_DAYS ============================= Minimum storage-file age in days for ``media_stale`` candidates. Defaults to ``7``. Must be a non-negative integer (``0`` removes the age delay). The newest available creation/modification timestamp must be at least this old; files with unknown ages are skipped. See :doc:`management-commands` for the dry run and deletion behavior. .. _cdn_configuration: ********************************* Using a CDN (AWS S3 + Cloudfront) ********************************* When using a CDN, s3 with cloudfront for example, there are some settings to put in your production config which are not really obvious: .. code-block:: python AWS_AUTO_CREATE_BUCKET = True AWS_S3_REGION_NAME = 'eu-central-1' # if your region differs from default AWS_S3_SIGNATURE_VERSION = 's3v4' AWS_S3_FILE_OVERWRITE = True AWS_S3_CUSTOM_DOMAIN = env('CLOUDFRONT_DOMAIN') Took me some time to figure out these settings. Those are additional settings, assumed you already used the django-cookiecutter template. Transcript completion handoff ============================= Completion tasks are queued only after the requesting database transaction commits, using its database alias. A rolled-back request queues no completion. A queue failure after commit leaves a failed, retryable attempt. Deferred callback failures are logged without failing an already-committed request or preventing later commit hooks; outside a transaction enqueue failures propagate immediately. Each queue or retry gets an immutable attempt ID, even when resuming the same remote job. Workers condition state changes and artifact publication on that identity; old workers cannot overwrite a replacement attempt after downloading artifacts. Apply migration 0087 and update producers and completion workers together. Queued tasks from older package versions without an attempt ID are ignored; allow their generation to become stale and retry it through the normal UI. Package adoption requires no new settings.