Template handler: Print debug statements when DEBUG is defined.