mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-07 13:34:53 +03:00
make the database cookiecutter connection and use of .env in that regard more clear for #490 and #270
This commit is contained in:
parent
aaa9800ba8
commit
1f0e055e67
|
@ -109,7 +109,15 @@ MANAGERS = ADMINS
|
|||
# ------------------------------------------------------------------------------
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
||||
DATABASES = {
|
||||
'default': env.db('DATABASE_URL', default='postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}'),
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': '{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}',
|
||||
'USER': env.db('DATABASE_USER', default=''),
|
||||
'PASSWORD': env.db('DATABASE_PASSWORD', default=''),
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '',
|
||||
'CONN_MAX_AGE': 0
|
||||
}
|
||||
}
|
||||
DATABASES['default']['ATOMIC_REQUESTS'] = True
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
# PostgreSQL
|
||||
POSTGRES_PASSWORD=mysecretpass
|
||||
POSTGRES_USER=postgresuser
|
||||
DATABASE_PASSWORD=mysecretpass
|
||||
DATABASE_USER=postgresuser
|
||||
|
||||
# General settings
|
||||
# DJANGO_READ_DOT_ENV_FILE=True
|
||||
|
|
Loading…
Reference in New Issue
Block a user