diff --git a/backend/config/settings.py b/backend/config/settings.py index 1d740db156..482f98c77b 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -170,11 +170,6 @@ WSGI_APPLICATION = "config.wsgi.application" - -# Database -# https://docs.djangoproject.com/en/4.0/ref/settings/#databases - - POSTGREST = { "URL": env.str("POSTGREST_URL", "http://api:3000"), "LOCAL": env.str("POSTGREST_URL", "http://api:3000"), @@ -232,12 +227,22 @@ # Environment specific configurations DEBUG = False if ENVIRONMENT not in ["DEVELOPMENT", "PREVIEW", "STAGING", "PRODUCTION"]: - DATABASES = { "default": env.dj_db_url( "DATABASE_URL", default="postgres://postgres:password@0.0.0.0/backend" ), } + STORAGES = { + "default": { + "BACKEND": "report_submission.storages.S3PrivateStorage", + }, + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage" + }, + } + # Per whitenoise docs, insert into middleware list directly after Django + # security middleware: https://whitenoise.readthedocs.io/en/stable/django.html#enable-whitenoise + MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # Local environment and Testing environment (CI/CD/GitHub Actions) @@ -248,10 +253,6 @@ CORS_ALLOWED_ORIGINS += ["http://0.0.0.0:8000", "http://127.0.0.1:8000"] - STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" - MIDDLEWARE.append("whitenoise.middleware.WhiteNoiseMiddleware") - DEFAULT_FILE_STORAGE = "report_submission.storages.S3PrivateStorage" - # Private bucket AWS_PRIVATE_STORAGE_BUCKET_NAME = "gsa-fac-private-s3" @@ -284,8 +285,14 @@ else: # One of the Cloud.gov environments - STATICFILES_STORAGE = "storages.backends.s3boto3.S3ManifestStaticStorage" - DEFAULT_FILE_STORAGE = "report_submission.storages.S3PrivateStorage" + STORAGES = { + "default": { + "BACKEND": "report_submission.storages.S3PrivateStorage", + }, + "staticfiles": { + "BACKEND": "storages.backends.s3boto3.S3ManifestStaticStorage", + }, + } vcap = json.loads(env.str("VCAP_SERVICES")) diff --git a/backend/manifests/vars/vars-staging.yml b/backend/manifests/vars/vars-staging.yml index de419aaac4..f35a00a90b 100644 --- a/backend/manifests/vars/vars-staging.yml +++ b/backend/manifests/vars/vars-staging.yml @@ -1,8 +1,8 @@ -app_name: gsa-fac -mem_amount: 2G -cf_env_name: STAGING -env_name: staging -service_name: staging -endpoint: fac-staging.app.cloud.gov -instances: 1 - +app_name: gsa-fac +mem_amount: 4G +cf_env_name: STAGING +env_name: staging +service_name: staging +endpoint: fac-staging.app.cloud.gov +instances: 1 +