From 9d0129da5617e25455a7f95628bb63014449dfd5 Mon Sep 17 00:00:00 2001 From: taoufik Date: Sun, 20 Oct 2019 12:39:32 +0100 Subject: [PATCH] Fix templates conflicts --- responder/api.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/responder/api.py b/responder/api.py index 601b066..17e150a 100644 --- a/responder/api.py +++ b/responder/api.py @@ -76,15 +76,6 @@ class API: self.static_dir = static_dir self.static_route = static_route - self.built_in_templates_dir = Path( - os.path.abspath(os.path.dirname(__file__) + "/templates") - ) - - if templates_dir is not None: - templates_dir = Path(os.path.abspath(templates_dir)) - - self.templates_dir = templates_dir or self.built_in_templates_dir - self.hsts_enabled = enable_hsts self.cors = cors self.cors_params = cors_params @@ -98,10 +89,8 @@ class API: allowed_hosts = ["*"] self.allowed_hosts = allowed_hosts - # Make the static/templates directory if they don't exist. - for _dir in (self.static_dir, self.templates_dir): - if _dir is not None: - os.makedirs(_dir, exist_ok=True) + if self.static_dir is not None: + os.makedirs(self.static_dir, exist_ok=True) if self.static_dir is not None: self.mount(self.static_route, self.static_app)