Skip to content

Commit

Permalink
CONN_MAX_AGE est défini en variable d'environnement (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolok authored Dec 3, 2024
1 parent e9975b1 commit d043cc6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
21 changes: 11 additions & 10 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
AIRFLOW_CONN_QFDMO_DJANGO_DB=postgresql+psycopg2://qfdmo:qfdmo@localhost:6543/qfdmo
AIRFLOW_WEBSERVER_REFRESHACTEUR_URL=http://localhost:8080
ALLOWED_HOSTS=localhost,127.0.0.1
AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
AWS_S3_ENDPOINT_URL='https://s3.fr-par.scw.cloud'
AWS_S3_REGION_NAME='fr-par'
AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
AWS_STORAGE_BUCKET_NAME='qfdmo-interface'
BASE_URL=http://localhost:8000
CARTE_MAX_SOLUTION_DISPLAYED=10
CONN_MAX_AGE=0
CORS_ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
DATABASE_URL=postgis://qfdmo:qfdmo@localhost:6543/qfdmo
DB_READONLY=postgis://qfdmo:qfdmo@localhost:6543/qfdmo
DEBUG=True
DEFAULT_MAX_SOLUTION_DISPLAYED=10
DISTANCE_MAX=30000
DJANGO_IMPORT_EXPORT_LIMIT=0
ENVIRONMENT=development
INSEE_KEY=<INSEE_KEY>
INSEE_SECRET=<INSEE_SECRET>
DEFAULT_MAX_SOLUTION_DISPLAYED=10
CARTE_MAX_SOLUTION_DISPLAYED=10
SECRET_KEY=my-secret-key
SENTRY_DSN=https://[email protected]/0
AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
AWS_S3_REGION_NAME='fr-par'
AWS_S3_ENDPOINT_URL='https://s3.fr-par.scw.cloud'
AWS_STORAGE_BUCKET_NAME='qfdmo-interface'
AIRFLOW_WEBSERVER_REFRESHACTEUR_URL=http://localhost:8080
CORS_ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
AIRFLOW_CONN_QFDMO_DJANGO_DB=postgresql+psycopg2://qfdmo:qfdmo@localhost:6543/qfdmo
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"filename": ".env.template",
"hashed_secret": "ccffafd813756ba7475f90e3c210d08d8edeb761",
"is_verified": false,
"line_number": 3
"line_number": 1
}
],
"README.md": [
Expand Down Expand Up @@ -207,5 +207,5 @@
}
]
},
"generated_at": "2024-11-21T09:58:18Z"
"generated_at": "2024-12-03T07:57:02Z"
}
8 changes: 2 additions & 6 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,15 @@ def context_processors():
readonly_settings = dj_database_url.parse(DB_READONLY)

DATABASES = {
"default": {
**default_settings,
"CONN_MAX_AGE": 60,
"CONN_HEALTH_CHECKS": True,
},
"default": default_settings,
"readonly": readonly_settings,
}

EXPLORER_CONNECTIONS = {"Default": "readonly"}
EXPLORER_DEFAULT_CONNECTION = "readonly"

CONN_HEALTH_CHECKS = True
CONN_MAX_AGE = None
CONN_MAX_AGE = decouple.config("CONN_MAX_AGE", cast=int, default=0)

# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
Expand Down

0 comments on commit d043cc6

Please sign in to comment.