Skip to content

Commit

Permalink
Merge branch 'main' into add-django-command-to-remove-unnecessary-wor…
Browse files Browse the repository at this point in the history
…kbook-artifacts
  • Loading branch information
sambodeme committed Aug 21, 2024
2 parents d4a6d3c + 9d4f0a2 commit 09d3382
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
31 changes: 19 additions & 12 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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:[email protected]/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)

Expand All @@ -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"

Expand Down Expand Up @@ -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"))

Expand Down
16 changes: 8 additions & 8 deletions backend/manifests/vars/vars-staging.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 09d3382

Please sign in to comment.