擅长:python、mysql、java
<p>您应该提供postgresql docker容器的名称作为<code>host</code>键的值:</p>
<pre class="lang-py prettyprint-override"><code>DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'fnf',
'USER': 'fnfuser',
'PASSWORD': 'fnf2pwd',
'HOST': 'fnf-postgis', # Name of postgres docker container
'PORT': 5432, # Its exposed port
}
}
</code></pre>