From 2750729bc99b6b6c876809302107e5571a09cd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 21 Jul 2015 13:45:25 +0300 Subject: [PATCH] combine css and js --- .gitignore | 3 ++- hc/settings.py | 8 ++++++++ requirements.txt | 1 + templates/base.html | 7 ++++--- templates/front/my_checks.html | 7 +++++-- templates/front/welcome.html | 6 +++++- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 99c06936..08e08461 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__/ -local_settings.py \ No newline at end of file +local_settings.py +static-collected \ No newline at end of file diff --git a/hc/settings.py b/hc/settings.py index c672d526..581da01b 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -30,6 +30,7 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'compressor', 'djrill', 'hc.accounts', @@ -92,6 +93,13 @@ PING_ENDPOINT = SITE_ROOT + "/ping/" STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] STATIC_ROOT = os.path.join(BASE_DIR, 'static-collected') +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder', +) +COMPRESS_OFFLINE = True + EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend" diff --git a/requirements.txt b/requirements.txt index df5c5440..df6db7ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Django==1.8.2 +django_compressor psycopg2==2.6 djrill pygments \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 22936b9f..2dfb65a6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,14 +6,17 @@ - {% load staticfiles %} + + {% load compress staticfiles %} + {% compress css %} + {% endcompress %}