Fix official image builds

I broke everything in https://github.com/ansible/awx/pull/11242.

These changes were necessary in order to run `awx-manage collectstatic` without a running database.
This commit is contained in:
Shane McDonald
2021-10-25 17:45:59 -04:00
parent 0ae67edaba
commit f6e63d0917
4 changed files with 16 additions and 3 deletions

View File

@@ -1,11 +1,14 @@
# AWX settings file
import os
import base64
def get_secret():
if os.path.exists("/etc/tower/SECRET_KEY"):
return open('/etc/tower/SECRET_KEY', 'rb').read().strip()
else:
return base64.encodebytes(os.urandom(32)).decode().rstrip()
ADMINS = ()
@@ -44,6 +47,7 @@ LOGGING['handlers']['console'] = {
'()': 'logging.StreamHandler',
'level': 'DEBUG',
'formatter': 'simple',
'filters': ['guid'],
}
LOGGING['loggers']['django.request']['handlers'] = ['console']
@@ -62,6 +66,9 @@ LOGGING['handlers']['tower_warnings'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['rbac_migrations'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['system_tracking_migrations'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['management_playbooks'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['dispatcher'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['job_lifecycle'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['wsbroadcast'] = {'class': 'logging.NullHandler'}
DATABASES = {
'default': {