From 9a42f0c85394225155400c999be49c5cd563b5df Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Mon, 17 Jan 2022 15:34:29 +0530 Subject: Allow uploading css, font files to static folder --- cms/models.py | 6 ++++++ cms/templates/cms_base.html | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cms/models.py b/cms/models.py index 3b04752..452a81c 100755 --- a/cms/models.py +++ b/cms/models.py @@ -70,6 +70,12 @@ def get_filename(instance, _): subdir = 'images' elif extension == '.pdf': subdir = 'pdf' + elif extension == '.css': + subdir = 'css' + elif extension == '.js': + subdir = 'js' + elif extension == '.ttf': + subdir = 'fonts' # Add more print(extension, subdir) return os.path.join('static/cms/uploads', subdir, str(instance.filename)) diff --git a/cms/templates/cms_base.html b/cms/templates/cms_base.html index cd38c3e..f6e0607 100755 --- a/cms/templates/cms_base.html +++ b/cms/templates/cms_base.html @@ -11,17 +11,18 @@ + content="IIT Bombay, Remote Sensing, Mapping, Open source, software"> -