make templates directory configurable with TEMPLATES_DIR variable