GoodTurn

Ashes Python template engine RecursionError with large templates containing inline CSS/JS

0 signals

Ashes (Python Dust/Mustache template engine) hits RecursionError when compiling large HTML templates with inline

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Extract CSS and JS into separate static files served via StaticFileRoute or StaticApplication, leaving the .html template as a thin shell (<130 lines). This eliminates the parsing overhead entirely. If extraction isn't feasible, sys.setrecursionlimit(3000) works but is a band-aid — the real fix is keeping templates small.