|
6 | 6 | from decouple import config |
7 | 7 | from sentry_sdk.integrations.django import DjangoIntegration |
8 | 8 |
|
9 | | - |
10 | | -# Celery Configuration Options |
11 | | -CELERY_TIMEZONE = "Europe/Moscow" |
12 | | -CELERY_TASK_TRACK_STARTED = True |
13 | | -CELERY_TASK_TIME_LIMIT = 30 * 60 |
14 | | -CELERY_BROKER_URL = config( |
15 | | - "CELERY_BROKER_URL", cast=str, default="redis://localhost:6379/0" |
16 | | -) |
17 | | -CELERY_RESULT_BACKEND = config("CELERY_RESULT_BACKEND", cast=str, default="redis") |
18 | | -# CELERY_ACCEPT_CONTENT = ["application/json"] |
19 | | -CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" |
20 | | - |
21 | | - |
22 | 9 | mimetypes.add_type("application/javascript", ".js", True) |
23 | 10 | mimetypes.add_type("text/css", ".css", True) |
24 | 11 | mimetypes.add_type("text/html", ".html", True) |
|
138 | 125 | "core.log.middleware.CustomLoguruMiddleware", |
139 | 126 | ] |
140 | 127 |
|
141 | | - |
142 | 128 | # CORS_ALLOWED_ORIGINS = [ |
143 | 129 | # "http://localhost:4200", |
144 | 130 | # "http://127.0.0.1:4200", |
|
191 | 177 |
|
192 | 178 | ASGI_APPLICATION = "procollab.asgi.application" |
193 | 179 |
|
194 | | - |
195 | 180 | REDIS_HOST = config("REDIS_HOST", cast=str, default="127.0.0.1") |
196 | | -CHANNEL_LAYERS = { |
197 | | - "default": { |
198 | | - "BACKEND": "channels_redis.core.RedisChannelLayer", |
199 | | - "CONFIG": { |
200 | | - "hosts": [(REDIS_HOST, 6379)], |
201 | | - }, |
202 | | - }, |
203 | | -} |
204 | | - |
205 | | -CACHES = { |
206 | | - "default": { |
207 | | - "BACKEND": "django.core.cache.backends.redis.RedisCache", |
208 | | - "LOCATION": f"redis://{REDIS_HOST}:6379", |
209 | | - } |
210 | | -} |
211 | 181 |
|
212 | 182 | if DEBUG: |
213 | 183 | DATABASES = { |
|
217 | 187 | } |
218 | 188 | } |
219 | 189 |
|
| 190 | + CACHES = { |
| 191 | + "default": { |
| 192 | + "BACKEND": "django_prometheus.cache.backends.filebased.FileBasedCache", |
| 193 | + "LOCATION": "/var/tmp/django_cache", |
| 194 | + } |
| 195 | + } |
| 196 | + |
| 197 | + CHANNEL_LERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}} |
220 | 198 | else: |
| 199 | + # fixme |
| 200 | + CACHES = { |
| 201 | + "default": { |
| 202 | + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", |
| 203 | + } |
| 204 | + } |
| 205 | + |
| 206 | + CHANNEL_LAYERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}} |
| 207 | + # CHANNEL_LAYERS = { |
| 208 | + # "default": { |
| 209 | + # "BACKEND": "channels_redis.core.RedisChannelLayer", |
| 210 | + # "CONFIG": { |
| 211 | + # "hosts": [("127.0.0.1", 6379)], |
| 212 | + # }, |
| 213 | + # }, |
| 214 | + # } |
| 215 | + # |
| 216 | + # REDIS_HOST = config("REDIS_HOST", cast=str, default="127.0.0.1") |
| 217 | + # CACHES = { |
| 218 | + # "default": { |
| 219 | + # "BACKEND": "django.core.cache.backends.redis.RedisCache", |
| 220 | + # "LOCATION": f"redis://{REDIS_HOST}:6379", |
| 221 | + # } |
| 222 | + # } |
| 223 | + |
221 | 224 | REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"] = [ |
222 | 225 | "rest_framework.renderers.JSONRenderer", |
223 | 226 | ] |
| 227 | + |
224 | 228 | DB_SERVICE = config("DB_SERVICE", default="postgres", cast=str) |
| 229 | + |
225 | 230 | DATABASES = { |
226 | 231 | "default": { |
227 | 232 | "ENGINE": "django_prometheus.db.backends.postgresql", |
|
339 | 344 | "enqueue": True, |
340 | 345 | } |
341 | 346 |
|
342 | | - |
343 | 347 | if DEBUG: |
344 | 348 | SELECTEL_SWIFT_URL += "debug/" |
345 | 349 |
|
|
0 commit comments