Skip to content

Commit

Permalink
Log stuff from building.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickFitz committed Feb 12, 2025
1 parent 0d84463 commit bf68e6b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions trade_remedies_api/config/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def get_allowed_hosts(self) -> list[str]:

def get_database_config(self) -> dict:
if self.build_step:
print(f"get_database_config: in build step according to {self.build_step}")
print(f"get_database_config: in build step according to {self.build_step}", file=sys.stderr)
return {"default": {}}

print(f"get_database_config: NOT in build step according to {self.build_step}")
print(f"get_database_config: NOT in build step according to {self.build_step}", file=sys.stderr)
return {
"default": dj_database_url.parse(database_url_from_env("DATABASE_CREDENTIALS")),
}
Expand Down
17 changes: 11 additions & 6 deletions trade_remedies_api/config/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Django settings for trade_remedies_api project."""

print("Start of settings", file=sys.stderr)
import datetime
import os
import sys
Expand Down Expand Up @@ -38,6 +38,7 @@ def strip_sensitive_data(event, hint):
pass
return event

print("Sentry config in settings", file=sys.stderr)

SENTRY_ENVIRONMENT = env.SENTRY_ENVIRONMENT
sentry_sdk.init(
Expand Down Expand Up @@ -152,6 +153,7 @@ def strip_sensitive_data(event, hint):
_VCAP_SERVICES = env.VCAP_SERVICES

DATABASES = env.get_database_config()
print("After database config in settings", file=sys.stderr)

AUTH_PASSWORD_VALIDATORS = [
{
Expand Down Expand Up @@ -444,13 +446,14 @@ def strip_sensitive_data(event, hint):

# Variable so we know if we're running in testing mode or not, this is True in the test.py settings
TESTING = False
print("Start of feature flags config in settings", file=sys.stderr)

# ------------------- FEATURE FLAGS -------------------
# try:
# conditions.register("PART_OF_GROUP", fn=is_user_part_of_group)
# except DuplicateCondition:
# # During deployment, this can sometimes be ran twice causing a DuplicateCondition error
# pass
try:
conditions.register("PART_OF_GROUP", fn=is_user_part_of_group)
except DuplicateCondition:
# During deployment, this can sometimes be ran twice causing a DuplicateCondition error
pass
FEATURE_FLAG_PREFIX = "FEATURE_FLAG"
FLAGS = {
f"{FEATURE_FLAG_PREFIX}_UAT_TEST": [
Expand All @@ -460,6 +463,7 @@ def strip_sensitive_data(event, hint):
{"condition": "PART_OF_GROUP", "value": True, "required": True},
],
}
print("End of feature flags config in settings", file=sys.stderr)

# ------------------- GOV.NOTIFY AUDIT COPY EMAILS -------------------
AUDIT_EMAIL_ENABLED = env.AUDIT_EMAIL_ENABLED
Expand Down Expand Up @@ -495,3 +499,4 @@ def strip_sensitive_data(event, hint):
MIDDLEWARE = MIDDLEWARE + [
"pyinstrument.middleware.ProfilerMiddleware",
]
print("End of settings", file=sys.stderr)

0 comments on commit bf68e6b

Please sign in to comment.