new monkey patching of flask for template rendering