-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing DATABASE_URL environment variable (#4096)
* Removing DATABASE_URL environment variable * Test unsetting env variable via scripts * Unsetting env variable from scripts * Testing a different approach * Removed unnecessary code * More cleaning * More cleaning
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"), | ||
|
@@ -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": | ||
|
@@ -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) | ||
|