diff options
author | Jayaram R Pai | 2014-10-04 17:30:23 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-10-04 17:30:23 +0530 |
commit | f7c72433cd6e96c52f1dd2cc87cf9e669b60cec6 (patch) | |
tree | 95fef3d9c817c70407483d53d351183b643b5e1d | |
parent | a242e5baeeef4edee62f8e2a3c2aa6fed1046590 (diff) | |
download | scipy2014-f7c72433cd6e96c52f1dd2cc87cf9e669b60cec6.tar.gz scipy2014-f7c72433cd6e96c52f1dd2cc87cf9e669b60cec6.tar.bz2 scipy2014-f7c72433cd6e96c52f1dd2cc87cf9e669b60cec6.zip |
started compressing css/js/html
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | requirements.txt | 8 | ||||
-rw-r--r-- | scipy/settings.py | 17 | ||||
-rw-r--r-- | static/CACHE/.notempty | 0 | ||||
-rw-r--r-- | static/website/css/main.css | 3 | ||||
-rwxr-xr-x | static/website/templates/base.html | 12 | ||||
-rwxr-xr-x | static/website/templates/home.html | 10 |
7 files changed, 45 insertions, 6 deletions
@@ -4,3 +4,4 @@ config.py wsgi.py static/uploads +static/CACHE diff --git a/requirements.txt b/requirements.txt index 0e0cef2..6a4da03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,16 @@ +BeautifulSoup==3.2.1 Django==1.5 MySQL-python==1.2.5 argparse==1.2.1 +beautifulsoup4==4.3.2 +cssmin==0.2.0 distribute==0.7.3 +django-appconf==0.6 +django-compressor==1.4 django-dajax==0.9.2 django-dajaxice==0.6 +django-htmlmin==0.7.0 django-widget-tweaks==1.3 +html5lib==1.0b3 +six==1.8.0 wsgiref==0.1.2 diff --git a/scipy/settings.py b/scipy/settings.py index f8c72ef..b817bfe 100644 --- a/scipy/settings.py +++ b/scipy/settings.py @@ -85,8 +85,10 @@ STATICFILES_DIRS = ( STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', + # 'django.contrib.staticfiles.finders.DefaultStorageFinder', + # Contrib finders. 'dajaxice.finders.DajaxiceFinder', + 'compressor.finders.CompressorFinder', ) # Make this unique, and don't share it with anybody. @@ -107,6 +109,9 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', + # Contrib middlewares. + 'htmlmin.middleware.HtmlMinifyMiddleware', + 'htmlmin.middleware.MarkRequestMiddleware', ) ROOT_URLCONF = 'scipy.urls' @@ -138,9 +143,12 @@ INSTALLED_APPS = ( 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', + # Contrib apps. 'widget_tweaks', 'dajaxice', 'dajax', + 'compressor', + # Custom apps. 'website', ) @@ -172,3 +180,10 @@ LOGGING = { }, } } +COMPRESS_ROOT = os.path.join(BASE_DIR, 'static') +COMPRESS_ENABLED = True +HTML_MINIFY = True +COMPRESS_CSS_FILTERS = [ + 'compressor.filters.cssmin.CSSMinFilter' +] + diff --git a/static/CACHE/.notempty b/static/CACHE/.notempty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/static/CACHE/.notempty diff --git a/static/website/css/main.css b/static/website/css/main.css index ff89ce4..0840e59 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -7,7 +7,6 @@ } body { background-color: #f3f1ea; - background-image: url('../images/ecailles.png'); } #page-wrapper { max-width: 960px; @@ -42,7 +41,6 @@ body { } #header{ height: 300px; - background: url("../images/jumbo_bg.jpg"); background-attachment: fixed; color: #ffffff; } @@ -132,7 +130,6 @@ body { } #page-header { height: 100px; - background: url("../images/jumbo_bg.jpg"); background-attachment: fixed; color: #ffffff; } diff --git a/static/website/templates/base.html b/static/website/templates/base.html index 9d02164..64febfd 100755 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -1,4 +1,5 @@ {% load static %} +{% load compress %} {% load dajaxice_templatetags %} {% load tags %} <!DOCTYPE html> @@ -8,7 +9,15 @@ <title>SciPy India 2014</title> <link rel="shortcut icon" type="image/png" href="{% static 'website/images/favicon.ico'%}"/> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + {% compress css %} <link rel="stylesheet" href="{% static 'website/css/main.css'%}"> + <!-- style rules that require relative image paths --> + <style> + body { background-image: url("{% static 'website/images/ecailles.png' %}"); } + #header{ background: url("{% static 'website/images/jumbo_bg.jpg' %}"); } + #page-header { background: url("{% static 'website/images/jumbo_bg.jpg' %}"); } + </style> + {% endcompress %} {% dajaxice_js_import %} </head> <body> @@ -95,8 +104,9 @@ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="{% static 'dajax/jquery.dajax.core.js' %}"></script> -<script src="{% static 'website/js/holder.js' %}"></script> +{% compress js %} <script src="{% static 'website/js/main.js' %}"></script> +{% endcompress %} <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), diff --git a/static/website/templates/home.html b/static/website/templates/home.html index 6ac8603..132927b 100755 --- a/static/website/templates/home.html +++ b/static/website/templates/home.html @@ -1,4 +1,5 @@ {% load static %} +{% load compress %} {% load tags %} <!DOCTYPE html> <html lang="en"> @@ -7,7 +8,15 @@ <title>SciPy India 2014</title> <link rel="shortcut icon" type="image/png" href="{% static 'website/images/favicon.ico'%}"/> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + {% compress css %} <link rel="stylesheet" href="{% static 'website/css/main.css'%}"> + <!-- style rules that require relative image paths --> + <style> + body { background-image: url("{% static 'website/images/ecailles.png' %}"); } + #header{ background: url("{% static 'website/images/jumbo_bg.jpg' %}"); } + #page-header { background: url("{% static 'website/images/jumbo_bg.jpg' %}"); } + </style> + {% endcompress %} </head> <body> <div id="page-wrapper"> @@ -246,7 +255,6 @@ </div> <!-- /#social --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> -<script src="{% static 'website/js/holder.js' %}"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |