---
summary: TemplateNotFound, missing variables, dict.items() gotcha.
title: Template rendering
path: troubleshooting/template-rendering
status: published
---

# Template rendering

## `TemplateNotFound: blog-post.html`

Delivery loads templates from S3 via the active template pack. Check:

1. Is the pack uploaded and marked as default for the site?
2. Does the manifest reference the template's slug?
3. Is the file path under `templates/` and does it match the manifest's
   `file:` field?

## "Variable X is undefined"

In dev: enable Jinja `StrictUndefined` to make this loud (see the renderer
config). In prod: a `{{ var | default('') }}` filter sweeps over expected-
nullable fields.

## "`{{ content.fields.items }}` shows `<built-in method items of dict>`"

Python dicts have a method called `items()`. Use bracket notation:

```jinja
{{ content.fields["items"] }}
```

This bites everyone once.

## "Blocks render as nothing"

Each block's `type` must match a key under `block_types` in the pack's
manifest. Unknown types are silently skipped. Add the block type to the
manifest (with `fields:` declaring its data shape) and re-upload the pack.
