|
10 | 10 | https://docs.djangoproject.com/en/4.1/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | | - |
14 | 13 | import os |
15 | 14 | from pathlib import Path |
16 | 15 |
|
|
28 | 27 | # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ |
29 | 28 |
|
30 | 29 | # Take environment variables from .env file |
31 | | -environ.Env.read_env(os.path.join(BASE_DIR, '.env')) |
| 30 | +environ.Env.read_env(os.path.join(BASE_DIR, ".env")) |
32 | 31 |
|
33 | 32 | # SECURITY WARNING: keep the secret key used in production secret! |
34 | | -SECRET_KEY = env('SECRET_KEY') |
| 33 | +SECRET_KEY = env("SECRET_KEY") |
35 | 34 |
|
36 | 35 | # SECURITY WARNING: don't run with debug turned on in production! |
37 | | -DEBUG = env('DEBUG') |
| 36 | +DEBUG = env("DEBUG") |
38 | 37 |
|
39 | | -ALLOWED_HOSTS = env.list('ALLOWED_HOSTS') |
40 | | -CSRF_TRUSTED_ORIGINS = env.list('CSRF_TRUSTED_ORIGINS') |
| 38 | +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS") |
| 39 | +CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS") |
41 | 40 |
|
42 | 41 | # Application definition |
43 | 42 |
|
|
100 | 99 |
|
101 | 100 | WSGI_APPLICATION = "rewardme.wsgi.application" |
102 | 101 |
|
103 | | -if USE_SQLITE := env('USE_SQLITE'): |
| 102 | +if USE_SQLITE := env("USE_SQLITE"): |
104 | 103 | DATABASES = { |
105 | 104 | "default": { |
106 | 105 | "ENGINE": "django.db.backends.sqlite3", |
|
110 | 109 | else: |
111 | 110 | DATABASES = { |
112 | 111 | "default": { |
113 | | - 'ENGINE': 'django.db.backends.postgresql', |
| 112 | + "ENGINE": "django.db.backends.postgresql", |
114 | 113 | "NAME": env("DB_NAME"), |
115 | 114 | "USER": env("DB_USER"), |
116 | 115 | "PASSWORD": env("DB_PASSWORD"), |
|
159 | 158 | STATIC_ROOT = BASE_DIR / "staticfiles" |
160 | 159 | COMPRESS_ENABLED = True |
161 | 160 | STATICFILES_FINDERS = ( |
162 | | - 'django.contrib.staticfiles.finders.FileSystemFinder', |
163 | | - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
164 | | - 'compressor.finders.CompressorFinder', |
| 161 | + "django.contrib.staticfiles.finders.FileSystemFinder", |
| 162 | + "django.contrib.staticfiles.finders.AppDirectoriesFinder", |
| 163 | + "compressor.finders.CompressorFinder", |
165 | 164 | ) |
166 | 165 |
|
167 | 166 | # Default primary key field type |
|
185 | 184 | ) |
186 | 185 |
|
187 | 186 | # Sentry |
188 | | -if USE_SENTRY := env.bool('USE_SENTRY', default=False): |
| 187 | +if USE_SENTRY := env.bool("USE_SENTRY", default=False): |
189 | 188 | import sentry_sdk |
190 | 189 | from sentry_sdk.integrations.django import DjangoIntegration |
191 | 190 |
|
192 | 191 | sentry_sdk.init( |
193 | | - dsn=env('SENTRY_DSN'), |
| 192 | + dsn=env("SENTRY_DSN"), |
194 | 193 | integrations=[DjangoIntegration()], |
195 | | - traces_sample_rate=env.float('SENTRY_TRACES_SAMPLE_RATE', default=0.1), |
| 194 | + traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.1), |
196 | 195 | send_default_pii=True, |
197 | | - release=env('SENTRY_RELEASE'), |
| 196 | + release=env("SENTRY_RELEASE"), |
198 | 197 | ) |
0 commit comments