A static site generator turns source pages and reusable components into website files. Each URL can map directly to a file on the server, avoiding database queries and making the result easy to cache. This is useful when a dynamic site would be overkill but consistent templates, such as a shared navigation bar, still matter. section 13.5
Django Distill applies this idea to a Django project. Install it with python -m pip install django-distill, add django_distill to INSTALLED_APPS, and replace path() with distill_path() in urls.py. The replacement preserves normal site behavior while adding a management command that writes static versions of mapped URLs; each distill_path() call also names the file to generate. section 13.5
A generator is especially helpful when:
- The site mostly serves fixed pages and does not need the overhead of a dynamic database-backed request. section 13.5
- Pages need reusable templates or components instead of manually maintained copies of shared elements. section 13.5
- A Django template engine is desirable, but serving generated HTML is preferable to hosting the complete Django site. section 1.2.3
A small recipe site
A family recipe site can store recipes in data files and use a simple view to render them as HTML. If one person edits the content, a content management system may be unnecessary; generating a static site keeps the Django-based rendering approach while avoiding a hosted dynamic application. section 13.5

