|
10 | 10 | https://docs.djangoproject.com/en/5.0/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
| 13 | +import os |
13 | 14 | from pathlib import Path |
14 | 15 |
|
15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
|
20 | 21 | # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ |
21 | 22 |
|
22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! |
23 | | -SECRET_KEY = "django-insecure-w^mv=r_(x-se8p#@i*dxfu1^*8$fci+116it+fkj*nx!o2h*r1" |
24 | | - |
| 24 | +SECRET_KEY = os.getenv( |
| 25 | + "DJANGO_SECRET_KEY", |
| 26 | + "django-insecure-w^mv=r_(x-se8p#@i*dxfu1^*8$fci+116it+fkj*nx!o2h*r1", |
| 27 | +) |
25 | 28 | # SECURITY WARNING: don't run with debug turned on in production! |
26 | | -DEBUG = True |
| 29 | +DEBUG = os.getenv("DJANGO_DEBUG", "False").lower() == "true" |
27 | 30 |
|
28 | | -ALLOWED_HOSTS = ["*"] |
| 31 | +ALLOWED_HOSTS = os.getenv("DJANGO_HOSTS", "*").split(",") |
29 | 32 |
|
30 | 33 |
|
31 | 34 | # Application definition |
32 | 35 |
|
33 | 36 | INSTALLED_APPS = [ |
| 37 | + "daphne", |
34 | 38 | "django.contrib.admin", |
35 | 39 | "django.contrib.auth", |
36 | 40 | "django.contrib.contenttypes", |
|
71 | 75 | ] |
72 | 76 |
|
73 | 77 | WSGI_APPLICATION = "config.wsgi.application" |
| 78 | +ASGI_APPLICATION = "config.asgi.application" |
74 | 79 |
|
75 | 80 |
|
76 | 81 | # Database |
77 | 82 | # https://docs.djangoproject.com/en/5.0/ref/settings/#databases |
78 | 83 |
|
79 | 84 | DATABASES = { |
80 | 85 | "default": { |
81 | | - "ENGINE": "django.db.backends.sqlite3", |
82 | | - "NAME": BASE_DIR / "db.sqlite3", |
| 86 | + "ENGINE": os.getenv("DJANGO_DATABASE_ENGINE", "django.db.backends.sqlite3"), |
| 87 | + "HOST": os.getenv("DJANGO_DATABASE_HOST"), |
| 88 | + "PORT": os.getenv("DJANGO_DATABASE_PORT", 5432), |
| 89 | + "NAME": os.getenv("POSTGRES_DB", BASE_DIR / "db.sqlite3"), |
| 90 | + "USER": os.getenv("POSTGRES_USER"), |
| 91 | + "PASSWORD": os.getenv("POSTGRES_PASSWORD"), |
83 | 92 | } |
84 | 93 | } |
85 | 94 |
|
|
119 | 128 | # https://docs.djangoproject.com/en/5.0/howto/static-files/ |
120 | 129 |
|
121 | 130 | STATIC_URL = "static/" |
| 131 | +STATIC_ROOT = os.getenv("DJANGO_STATIC_ROOT") |
122 | 132 |
|
123 | 133 | # Default primary key field type |
124 | 134 | # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field |
|
0 commit comments