Open IlyaSemenov opened 4 years ago
With authentication, this gets even weirder. For Django config:
DATABASES = {
"default": {
"NAME": "foo",
"USER": "foo",
"PASSWORD": "bang",
"HOST": "",
"PORT": "",
"OPTIONS": {"host": "/tmp/myproject:us-east1:foo"},
"ENGINE": "django.db.backends.postgresql",
}
}
your build_engine_url
returns:
postgresql://foo:bangfoo
🤦
Luckily the related code isn't hidden behind layers of closures, so a simple monkey patch would suffice:
import jet_bridge_base.db
jet_bridge_base.db.build_engine_url = lambda conf: env.str("DATABASE_URL")
Currently, there is no way to connect to a Postgres running on a custom socket (e.g. in Google App Engine).
1) with this Django
settings.py
(as per Django docs):jet-admin fails:
2) with this Django
settings.py
:jet-admin constructs weird URL and ignores the options:
3) with this Django
settings.py
:it still fails to connect:
4) with this Django
settings.py
:it's finally constructing a working connection string:
but, in this case Django wouldn't connect to the database.