publik-devinst/roles/app-setup/templates/app-settings-base.j2

62 lines
1.6 KiB
Django/Jinja

# This file is sourced by "execfile" from hobo.settings
# Don't modify this file, it will be overwritten if you update your
# publik installation.
# Custom settings should be declared in *.py file under the settings.d directory
import glob
import os
from django.utils import six
{% block app_custom_before %}{% endblock %}
PROJECT_NAME = "{{project_name}}"
exec(open('{{src_dir}}/hobo/debian/debian_config_common.py').read())
THEMES_DIRECTORY = '{{themes_dir}}'
ALLOWED_HOSTS = ['*']
if PROJECT_NAME != 'wcs':
DATABASES['default']['PORT'] = {{postgresql_port}}
LOGGING = {
'disable_existing_loggers': True,
'filters': {
'request_context': {'()': 'hobo.logger.RequestContextFilter'},
'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'},
'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
}
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'DEBUG'
},
'django.request': {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
}
},
'version': 1
}
DEBUG = True
# https://docs.djangoproject.com/fr/2.2/topics/email/#file-backend
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/publik-devinst-mails' # will be auto-created
{% block app_custom_after %}{% endblock %}
for filename in sorted(
glob.glob(os.path.join('{{app_settings_dir}}', 'settings.d', '*.py'))):
exec(open(filename).read())