mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-23 15:54:12 +03:00
* Set CONN_MAX_AGE to 60 seconds -- fixes #710 Setting the value in the production config. * Get CONN_MAX_AGE from the environment, default to 60 in .env * Add test for CONN_MAX_AGE setting * Remove duplication in default value & test cleanup * Remove test for CONN_MAX_AGE value in settings
This commit is contained in:
parent
b00b402774
commit
4f8cd89bb7
|
@ -169,7 +169,7 @@ TEMPLATES[0]['OPTIONS']['loaders'] = [
|
|||
('django.template.loaders.cached.Loader', [
|
||||
'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ]),
|
||||
]
|
||||
|
||||
{% set _DEFAULT_CONN_MAX_AGE=60 %}
|
||||
# DATABASE CONFIGURATION
|
||||
# ------------------------------------------------------------------------------
|
||||
{% if cookiecutter.use_elasticbeanstalk_experimental.lower() == 'y' -%}
|
||||
|
@ -182,12 +182,14 @@ DATABASES = {
|
|||
'PASSWORD': env('RDS_PASSWORD'),
|
||||
'HOST': env('RDS_HOSTNAME'),
|
||||
'PORT': env('RDS_PORT'),
|
||||
'CONN_MAX_AGE': env.int('CONN_MAX_AGE', default={{ _DEFAULT_CONN_MAX_AGE }}),
|
||||
}
|
||||
}
|
||||
{% else %}
|
||||
# Use the Heroku-style specification
|
||||
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
|
||||
DATABASES['default'] = env.db('DATABASE_URL')
|
||||
DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default={{ _DEFAULT_CONN_MAX_AGE }})
|
||||
{%- endif %}
|
||||
|
||||
# CACHING
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# PostgreSQL
|
||||
POSTGRES_PASSWORD=mysecretpass
|
||||
POSTGRES_USER=postgresuser
|
||||
CONN_MAX_AGE=
|
||||
|
||||
# Domain name, used by caddy
|
||||
DOMAIN_NAME={{ cookiecutter.domain_name }}
|
||||
|
|
Loading…
Reference in New Issue
Block a user