From 0dbb737f2015d61304b291d5afbc54e230606742 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Mon, 17 Jun 2013 12:31:26 -0400 Subject: [PATCH] Added setting for using minified JS in production. --- ansibleworks/settings/defaults.py | 3 +++ ansibleworks/settings/production.py | 3 +++ ansibleworks/ui/templates/ui/index.html | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ansibleworks/settings/defaults.py b/ansibleworks/settings/defaults.py index 5f8a88fe9f..88f3947603 100644 --- a/ansibleworks/settings/defaults.py +++ b/ansibleworks/settings/defaults.py @@ -148,6 +148,9 @@ REST_FRAMEWORK = { ), } +# If set, serve only minified JS for UI. +USE_MINIFIED_JS = False + # Email address that error messages come from. SERVER_EMAIL = 'root@localhost' diff --git a/ansibleworks/settings/production.py b/ansibleworks/settings/production.py index 41d74684d6..092c296838 100644 --- a/ansibleworks/settings/production.py +++ b/ansibleworks/settings/production.py @@ -18,6 +18,9 @@ SECRET_KEY = None # See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] +# Production should only use minified JS for UI. +USE_MINIFIED_JS = True + # If a local_settings.py file is present here, use it and ignore the global # settings. Normally, local settings would only be present during development. try: diff --git a/ansibleworks/ui/templates/ui/index.html b/ansibleworks/ui/templates/ui/index.html index 6662289dcd..e9cf7feb96 100644 --- a/ansibleworks/ui/templates/ui/index.html +++ b/ansibleworks/ui/templates/ui/index.html @@ -14,7 +14,7 @@ - {% if 0 and not settings.DEBUG %} {# FIXME: Change to use minified JS once we are building it. #} + {% if settings.USE_MINIFIED_JS %} {# FIXME: Change to use minified JS once we are building it. #} {% else %}