Use the htmlmin Django Middleware to reduce data usage
Typical index html load reduced by 21% Typical viewtest html load reduced by 44% Typical search html load reduced by 12% Small style fixes to account for spaceless html
This commit is contained in:
1 parent
9ec29cf03b
commit
98e6e009f0
2 files changed
+6
-5
No files matched your search
@@ -37,6 +37,7 @@ a:link, a:visited, a:hover, a:active {
|
||||
|
||||
#content label {
|
||||
width: 120px;
|
||||
padding-right: 10px;
|
||||
font-weight:bold;
|
||||
text-align: right;
|
||||
display: inline-block;
|
||||
@@ -128,6 +129,7 @@ a:link, a:visited, a:hover, a:active {
|
||||
#content #actions .anchorbutton {
|
||||
color: #000000;
|
||||
padding: 8px 8px;
|
||||
margin: 0px 8px;
|
||||
border-radius: 8px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
||||
@@ -15,18 +15,15 @@ import os
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = '@!zw2l8til1(0eb_nk+1w!(n78gqm&u)s)_v7#k6iseia@g9q0'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
SECRET_KEY = '@!zw2l8til1(0eb_nk+1w!(n78gqm&u)s)_v7#k6iseia@g9q0'
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
HTML_MINIFY = True
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -54,6 +51,8 @@ MIDDLEWARE = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'htmlmin.middleware.HtmlMinifyMiddleware',
|
||||
'htmlmin.middleware.MarkRequestMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'OpenSite.urls'
|
||||
|
||||
Reference in new issue
Block a user