Open jnm opened 4 years ago
@jnm I would recommend to apply the changes only in last version of KoBoCAT (Django 2/ Python 3) to avoid conflicts.
quick note in case Josh is working on this :grin:
i'm not entirely sure what TEMPLATE_DEBUG
actually does, or why we would need to toggle it separately from DEBUG
. at first blush, i'd say:
TEMPLATE_DEBUG
simply follow DEBUG
(instead of reading from the environment)DEBUG
from the environment, but default to false@jnm, @joshuaberetta
FYI: TEMPLATE_DEBUG
is deprecated anyway (since 2.0 I think)
I did change it in KoBoCAT upgrade
In case GH does not follow the link, look at debug
property of TEMPLATES
.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': False,
'DIRS': [
os.path.join(TEMPLATE_OVERRIDE_ROOT_DIR, 'templates'),
os.path.join(ONADATA_DIR, 'libs/templates')
],
'OPTIONS': {
'context_processors': [
'onadata.koboform.context_processors.koboform_integration',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
'readonly.context_processors.readonly',
'onadata.apps.main.context_processors.google_analytics',
'onadata.apps.main.context_processors.site_name',
'onadata.apps.main.context_processors.base_url'
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
]
],
'debug': os.environ.get('TEMPLATE_DEBUG', 'False') == 'True',
},
}
]
Note that is enforced to False
on production in latest version of Django2/Python3 upgrade of KoBoCAT.
https://github.com/kobotoolbox/kobocat/blob/0cdddf8543b00beaca3b4a7853bbc3e6653d71b8/onadata/settings/prod.py#L10-L11
https://github.com/kobotoolbox/kobocat/blob/828081dde9ac211e0ef512f7db3410abf3dcb0f2/onadata/settings/kc_environ.py#L29-L30