Cookiecutter-django: Unconditionally connect to database from DATABASE_URL env when opting for Docker

Created on 1 Mar 2018  路  3Comments  路  Source: pydanny/cookiecutter-django

E.g. in config.settings.base:

DATABASES = {
    'default': env.db('DATABASE_URL'),
}
docker help wanted

Most helpful comment

Great! Good to know the issue has been reported.

I tried to apply the changes proposed in #1950. But unfortunately that was not enough. My current workaround was to provide the following default value for the DATABASE_URL environment variable, not explicitly set in non-Docker deployments:

DATABASES = {
    'default': env.db('DATABASE_URL', default='postgres:///{{cookiecutter.project_slug}}'),
}

I wonder why that default has been removed in 6c26d39f65a66429ae1ec9a00d9676f29c408c45.

All 3 comments

I currently use Docker for local development, but removing the default value Travic CI builds fail.

Yes, the Travis config isn't suitable for Docker currently. See #2100

Great! Good to know the issue has been reported.

I tried to apply the changes proposed in #1950. But unfortunately that was not enough. My current workaround was to provide the following default value for the DATABASE_URL environment variable, not explicitly set in non-Docker deployments:

DATABASES = {
    'default': env.db('DATABASE_URL', default='postgres:///{{cookiecutter.project_slug}}'),
}

I wonder why that default has been removed in 6c26d39f65a66429ae1ec9a00d9676f29c408c45.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

japrogramer picture japrogramer  路  4Comments

webyneter picture webyneter  路  4Comments

StupidTAO picture StupidTAO  路  3Comments

webyneter picture webyneter  路  4Comments

pygabo picture pygabo  路  3Comments