Hi David,

Thanks again for the input. I havent quite figured it out yet but I
appreciate the help!

Best,
Marc

On Thu, Nov 5, 2020 at 8:02 AM David Nugent <[email protected]> wrote:

>
>
> On 5 Nov 2020, at 04:11, Marc Johnson <[email protected]> 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
>
>
>

-- 
M: +1-646-541-2108
W: marcjohnson.info <https://www.marcjohnson.info/>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACH3BCSBvDA3k74kn0XLv%3DeD%3DmqrSX16jTHPxTLRVCqH8Jk4Yg%40mail.gmail.com.

Reply via email to