|
36 | 36 | CORS_ALLOW_HEADERS = default_headers + ( |
37 | 37 | 'access-control-allow-headers', |
38 | 38 | 'access-control-allow-methods', |
| 39 | + 'access-control-allow-origin' |
39 | 40 | ) |
40 | 41 |
|
41 | 42 | # Application definition |
|
102 | 103 | 'django.middleware.security.SecurityMiddleware', |
103 | 104 | 'django.contrib.sessions.middleware.SessionMiddleware', |
104 | 105 | 'social_django.middleware.SocialAuthExceptionMiddleware', |
| 106 | + 'corsheaders.middleware.CorsMiddleware', |
105 | 107 | 'django.middleware.common.CommonMiddleware', |
106 | 108 | 'django.middleware.csrf.CsrfViewMiddleware', |
107 | 109 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
136 | 138 | DATABASES = { |
137 | 139 | 'default': { |
138 | 140 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
139 | | - 'NAME': os.environ.get('RDS_DB_NAME', 'postgres'), |
140 | | - 'USER': os.environ.get('RDS_USERNAME', 'postgres'), |
141 | | - 'PASSWORD': os.environ.get('RDS_PASSWORD', 'postgres'), |
142 | | - 'HOST': os.environ.get('RDS_HOSTNAME', 'postgres'), |
143 | | - 'PORT': os.environ.get('RDS_PORT', 5432), |
| 141 | + 'NAME': os.environ.get('POSTGRES_NAME', 'postgres'), |
| 142 | + 'USER': os.environ.get('POSTGRES_USERNAME', 'postgres'), |
| 143 | + 'PASSWORD': os.environ.get('POSTGRES_PASSWORD', 'postgres'), |
| 144 | + 'HOST': os.environ.get('POSTGRES_SERVICE_HOST', 'postgres'), |
| 145 | + 'PORT': os.environ.get('POSTGRES_SERVICE_PORT', 5432), |
144 | 146 | } |
145 | 147 | } |
146 | 148 |
|
147 | 149 | ASGI_APPLICATION = 'backend.routing.application' |
148 | 150 |
|
149 | | -ELASTICACHE_REDIS_HOST_NAME = \ |
| 151 | +REDIS_SERVICE_HOST = \ |
150 | 152 | os.environ.get( |
151 | | - 'CELERY_BROKER_URL', |
| 153 | + 'REDIS_SERVICE_HOST', |
152 | 154 | 'redis://redis:6379' |
153 | | - )[8:].split(':')[0] |
| 155 | + ) |
154 | 156 |
|
155 | 157 | CHANNEL_LAYERS = { |
156 | 158 | 'default': { |
157 | 159 | 'BACKEND': 'channels_redis.core.RedisChannelLayer', |
158 | 160 | 'CONFIG': { |
159 | | - "hosts": [(ELASTICACHE_REDIS_HOST_NAME, 6379)], |
| 161 | + "hosts": [(REDIS_SERVICE_HOST, 6379)], |
160 | 162 | }, |
161 | 163 | }, |
162 | 164 | } |
163 | 165 |
|
164 | 166 | REDIS = redis.Redis( |
165 | | - host=ELASTICACHE_REDIS_HOST_NAME, |
| 167 | + host=REDIS_SERVICE_HOST, |
166 | 168 | port=6379, |
167 | 169 | db=3, |
168 | 170 | charset="utf-8", |
|
186 | 188 |
|
187 | 189 | # Celery Configuration |
188 | 190 |
|
189 | | -CELERY_BROKER_URL = \ |
190 | | - os.environ.get('CELERY_BROKER_URL', 'redis://redis:6379') |
191 | | -CELERY_RESULT_BACKEND = \ |
192 | | - os.environ.get('CELERY_RESULT_BACKEND', 'redis://redis:6379') |
193 | 191 | CELERY_ACCEPT_CONTENT = ['application/json'] |
194 | 192 | CELERY_TASK_SERIALIZER = 'json' |
195 | 193 | CELERY_RESULT_SERIALIZER = 'json' |
|
0 commit comments