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
