Skip to content

Commit

Permalink
Merge pull request #4105 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Jul 23, 2024
2 parents 644e92b + 9e9d4b3 commit ecf0e87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ if [[ "$CF_INSTANCE_INDEX" == 0 ]]; then
fi

# Make psql usable by scripts, for debugging, etc.
alias psql='/home/vcap/deps/0/apt/usr/lib/postgresql/*/bin/psql'
alias psql='/home/vcap/deps/0/apt/usr/lib/postgresql/*/bin/psql'
13 changes: 8 additions & 5 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

DATABASES = {
"default": env.dj_db_url(
"DATABASE_URL", default="postgres://postgres:[email protected]/backend"
),
}

POSTGREST = {
"URL": env.str("POSTGREST_URL", "http://api:3000"),
Expand Down Expand Up @@ -237,6 +232,13 @@
# 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"
),
}

# Local environment and Testing environment (CI/CD/GitHub Actions)

if ENVIRONMENT == "LOCAL":
Expand Down Expand Up @@ -284,6 +286,7 @@
# One of the Cloud.gov environments
STATICFILES_STORAGE = "storages.backends.s3boto3.S3ManifestStaticStorage"
DEFAULT_FILE_STORAGE = "report_submission.storages.S3PrivateStorage"

vcap = json.loads(env.str("VCAP_SERVICES"))

DB_URL = get_db_url_from_vcap_services(vcap)
Expand Down

0 comments on commit ecf0e87

Please sign in to comment.