On 5 Nov 2020, at 04:11, Marc Johnson 
<marcjohnson...@gmail.com<mailto:marcjohnson...@gmail.com>> wrote:

Hi David,

Thanks again for the feedback. When I remove the 'ENGINE' variable I get the 
error saying settings.DATABASES is improperly configured, as shown in the 
snapshot attached below.

But when I add the ENGINE variable, like listed below, I get an 'Internal 
Server Error':

DATABASES = {
    'default': dj_database_url.config(env='DATABASE_URL', conn_max_age=1800),
    'ENGINE': 'django.db.backends.postgresql',
}

My db settings in my docker-compose.yml file are also provided below:

  db:
    image: postgres:11
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - "DATABASE_URL=postgresql://postgres:P#ssw0rd@postgres:5432/ndc_data"
      - "POSTGRES_HOST_AUTH_METHOD=trust"
      - "POSTGRES_PASSWORD=P#ssw0rd"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_DB=ndc_data"
      - "POSTGRES_HOST=postgres"
    networks:
      - default

How am I screwing this up so royally!? I did not expect this connection to 
involve so much troubleshooting.


It shouldn't. Note that env='DATABASE_URL' is entirely redundant and can be 
omitted.

In any case, check the source code for dj_database_url.config to troubleshoot 
this, but ENGINE definitely isn't needed here. As you'll see from the source, 
the url scheme determines the engine used.

Did you validate that DATABASE_URL is set correctly in the container 
environment?
I suspect this may be the issue here, although the docker-compose.yml looks 
fine.

Regards,
/d


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA458F7B-A42B-4852-B9DA-FD913A151FE8%40uniquode.io.

Reply via email to