Project

Profile

Help

Issue #4679

closed

Custom settings not propogating

Added by tustvold over 5 years ago. Updated over 5 years ago.

Status:
CLOSED - WORKSFORME
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 51
Quarter:

Description

I'm trying to configure the S3 storage backend, however, am running into an issue with settings not propogating correctly.

I have set DJANGO_SETTINGS_MODULE to pulpcore.app.settings as an environment variable, and additionally have set PULP_SETTINGS to /var/lib/pulp/settings.yaml which is where I have set the variables. The templated contents of which are below:

default:
  # Django
  SECRET_KEY: '${PULP_SECRET}'
  DEBUG: True

  CONTENT_HOST: '${CONTENT_HOST}'

  # Redis
  REDIS_HOST: '${REDIS_HOST}'
  REDIS_PORT: ${REDIS_PORT}
  REDIS_PASSWORD: '${REDIS_PASSWORD}'

  # Storage
  AWS_ACCESS_KEY_ID: '${S3_ACCESS_KEY_ID}'
  AWS_SECRET_ACCESS_KEY: '${S3_SECRET_ACCESS_KEY}'
  AWS_STORAGE_BUCKET_NAME: '${S3_STORAGE_BUCKET_NAME}'
  AWS_DEFAULT_ACL:
  AWS_AUTO_CREATE_BUCKET: False

  DEFAULT_FILE_STORAGE: storages.backends.s3boto3.S3Boto3Storage
  MEDIA_ROOT:  ''

  # Postgres
  DATABASES:
    default:
      CONN_MAX_AGE: 0
      ENGINE: django.db.backends.postgresql_psycopg2
      NAME: '${PGSQL_DB}'
      USER: '${PGSQL_USER}'
      PASSWORD: '${PGSQL_PASSWORD}'
      HOST: '${PGSQL_HOST}'
      PORT: ${PGSQL_PORT}

The problem appears to be that pulpcore.app.settings is following the explicit approach as described here but is missing the crucial settings.populate_obj(sys.modules[__name__]). This means that only the settings explicitly mentioned in the file are propogated.

Caveat: I am new to django and dynaconf so might be missing something incredibly obvious

Also available in: Atom PDF