|
22 | 22 |
|
23 | 23 | from .cache_settings import * |
24 | 24 |
|
25 | | -env = environ.Env(DEBUG=(bool, False)) |
26 | | -DEBUG = env.bool("DEBUG", default=True) |
27 | 25 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
28 | 26 | BASE_DIR = Path(__file__).resolve().parent.parent |
| 27 | + |
| 28 | +# Load .env file FIRST, before reading any env variables |
| 29 | +env = environ.Env(DEBUG=(bool, False)) |
29 | 30 | environ.Env.read_env(os.path.join(BASE_DIR, ".env")) |
30 | 31 |
|
| 32 | +DEBUG = env.bool("DEBUG", default=True) |
| 33 | + |
31 | 34 | # Quick-start development settings - unsuitable for production |
32 | 35 | # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ |
33 | 36 |
|
|
301 | 304 |
|
302 | 305 | # Swagger Settings |
303 | 306 | SWAGGER_SETTINGS = { |
304 | | - "SECURITY_DEFINITIONS": { |
305 | | - "Bearer": {"type": "apiKey", "name": "Authorization", "in": "header"} |
306 | | - } |
| 307 | + "SECURITY_DEFINITIONS": {"Bearer": {"type": "apiKey", "name": "Authorization", "in": "header"}} |
307 | 308 | } |
308 | 309 |
|
309 | 310 | # Structured Logging Configuration |
|
370 | 371 |
|
371 | 372 | # OpenTelemetry Sampling Configuration |
372 | 373 | OTEL_TRACES_SAMPLER = "parentbased_traceidratio" |
373 | | -OTEL_TRACES_SAMPLER_ARG = os.getenv( |
374 | | - "OTEL_TRACES_SAMPLER_ARG", "1.0" |
375 | | -) # Sample 100% in dev |
| 374 | +OTEL_TRACES_SAMPLER_ARG = os.getenv("OTEL_TRACES_SAMPLER_ARG", "1.0") # Sample 100% in dev |
376 | 375 |
|
377 | 376 | # OpenTelemetry Metrics Configuration |
378 | | -OTEL_METRIC_EXPORT_INTERVAL_MILLIS = int( |
379 | | - os.getenv("OTEL_METRIC_EXPORT_INTERVAL_MILLIS", "30000") |
380 | | -) |
381 | | -OTEL_METRIC_EXPORT_TIMEOUT_MILLIS = int( |
382 | | - os.getenv("OTEL_METRIC_EXPORT_TIMEOUT_MILLIS", "30000") |
383 | | -) |
| 377 | +OTEL_METRIC_EXPORT_INTERVAL_MILLIS = int(os.getenv("OTEL_METRIC_EXPORT_INTERVAL_MILLIS", "30000")) |
| 378 | +OTEL_METRIC_EXPORT_TIMEOUT_MILLIS = int(os.getenv("OTEL_METRIC_EXPORT_TIMEOUT_MILLIS", "30000")) |
384 | 379 |
|
385 | 380 | # OpenTelemetry Instrumentation Configuration |
386 | 381 | OTEL_PYTHON_DJANGO_INSTRUMENT = True |
|
0 commit comments