Skip to content

Commit

Permalink
WIP README and allowed_host
Browse files Browse the repository at this point in the history
  • Loading branch information
gnthibault committed Nov 15, 2024
1 parent 463c3eb commit 5590ffa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mytom/mytom/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
# Change this to "False" when you are ready for production
env = environ.Env(DEBUG=(bool, False))
env_file = os.path.join(BASE_DIR, ".env")

logger = logging.getLogger(__name__)
# Attempt to load the Project ID into the environment, safely failing on error.
try:
_, os.environ["GOOGLE_CLOUD_PROJECT"] = google.auth.default()
Expand All @@ -225,7 +225,7 @@
name = f"projects/{project_id}/secrets/{settings_name}/versions/latest"
payload = client.access_secret_version(name=name).payload.data.decode("UTF-8")
env.read_env(io.StringIO(payload))
print(f"env is {env}")
logger.info(f'env is {env}')
else:
raise Exception("No local .env or GOOGLE_CLOUD_PROJECT detected. No secrets found.")

Expand All @@ -235,7 +235,7 @@
if os.getenv("USE_CLOUD_SQL_AUTH_PROXY", None):
DATABASES["default"]["HOST"] = "127.0.0.1"
DATABASES["default"]["PORT"] = 5432
print(f"Database is {DATABASES}")
logger.info(f'Database is {DATABASES}')
# django.db.connection.ensure_connection()

GS_BUCKET_NAME = env("GS_BUCKET_NAME")
Expand Down

0 comments on commit 5590ffa

Please sign in to comment.