liveBook · Manning

Distill_path

As explained in Django in Action

distill_path is a django-distill URL-mapping function that associates a view with a route and the filename to generate for it.

distill_path() is Django Distill’s replacement for path(). It maps a URL route to a view while also naming the file that should be generated for that route. section 13.5

The mental model is simple: Django still handles the URL mapping, but Distill adds a build step that follows those mappings and writes static files. The application can then be hosted without a running Django backend. section 13.5

A static recipe route

A URL configuration can replace a normal path mapping with distill_path(), supplying the route, view, and output filename. A management command can then generate static versions of the mapped URLs. Distill supports GET views only; POST handling requires a dynamic backend. section 13.5

Using distill_path() involves three practical steps:

  • Install django-distill and add django_distill to INSTALLED_APPS. section 13.5
  • Use distill_path() in urls.py where a static page should be generated. section 13.5
  • Run the provided management command to output the generated site files. section 13.5

How Django in Action covers it

How deep it goes
Explains replacement behavior, file generation, installation, and GET-only limits without detailing argument-bearing views.
Examples
Uses a family recipe site whose data-driven views become static HTML files.
What it assumes
Assumes familiarity with Django URL mappings and views, while preserving path()-like routing behavior.
What you can do after
Operate/configure Django Distill to generate static files from mapped GET views.
How it connects
Connects Django URL routing, Django views, management commands, and static-site generation.

This explainer was generated by Manning's knowledge graph from the text of Django in Action. The section links point to the parts of the book it draws on.