refactor requirements and make htmlmin optional

This commit is contained in:
Laura Klünder 2016-09-12 10:55:01 +02:00
parent 2a86e012dd
commit c6c8dbeab4
12 changed files with 26 additions and 17 deletions

View file

@ -125,10 +125,18 @@ MIDDLEWARE_CLASSES = [
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'htmlmin.middleware.HtmlMinifyMiddleware',
'htmlmin.middleware.MarkRequestMiddleware',
]
try:
import htmlmin # noqa
except ImportError:
pass
else:
MIDDLEWARE_CLASSES += [
'htmlmin.middleware.HtmlMinifyMiddleware',
'htmlmin.middleware.MarkRequestMiddleware',
]
# Security settings
X_FRAME_OPTIONS = 'DENY'