We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 506c397 commit cb0315fCopy full SHA for cb0315f
1 file changed
config/settings/base.py
@@ -103,8 +103,9 @@
103
# See dev.py and prod.py for environment-specific database settings.
104
105
# Support DATABASE_URL (Render) or individual DB_* vars
106
-db_url = os.getenv("DATABASE_URL", "").strip()
107
-if db_url and "//" in db_url and "postgres" in db_url:
+db_url = os.getenv("DATABASE_URL", "")
+# Validate: must contain :// and postgres, NOT be literal "DATABASE_URL"
108
+if db_url and "://" in db_url and "postgres" in db_url and db_url != "DATABASE_URL":
109
# Use DATABASE_URL from Render
110
DATABASES = {"default": env.db_url_config("DATABASE_URL")}
111
else:
0 commit comments