11import os
22from pathlib import Path
3+ from decouple import config , Csv
34
45# Build paths inside the project like this: BASE_DIR / 'subdir'.
56BASE_DIR = Path (__file__ ).resolve ().parent .parent
89# Quick-start development settings - unsuitable for production
910# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
1011
11- # SECURITY WARNING: keep the secret key used in production secret!
12- SECRET_KEY = 'django-insecure-%ih9li)=no$9s=93us((337b-79ya*%psbm)=0(csy^$c*qg%^'
13-
14- # SECURITY WARNING: don't run with debug turned on in production!
15- DEBUG = True
16-
17- ALLOWED_HOSTS = []
18-
1912
2013# Application definition
2114
6861WSGI_APPLICATION = 'taskflow_api.wsgi.application'
6962
7063
71- # Database
72- # https://docs.djangoproject.com/en/5.2/ref/settings/#databases
73-
74- # DATABASES = {
75- # 'default': {
76- # 'ENGINE': 'django.db.backends.sqlite3',
77- # 'NAME': BASE_DIR / 'db.sqlite3',
78- # }
79- # }
80-
81- DATABASES = {
82- 'default' : {
83- 'ENGINE' : 'django.db.backends.postgresql' ,
84- 'NAME' : os .getenv ('POSTGRES_DB' ),
85- 'USER' : os .getenv ('POSTGRES_USER' ),
86- 'PASSWORD' : os .getenv ('POSTGRES_PASSWORD' ),
87- 'HOST' : os .getenv ('POSTGRES_HOST' , 'localhost' ),
88- 'PORT' : os .getenv ('POSTGRES_PORT' , '5432' ),
89- }
90- }
91-
9264# Password validation
9365# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
9466
136108# MANUALLY ADDED
137109
138110CORS_ALLOW_ALL_ORIGINS = True
111+
112+
113+ DEBUG = config ('DEBUG' , default = False , cast = bool )
114+ SECRET_KEY = config ('SECRET_KEY' , default = 'unsafe-dev-key' )
115+
116+ ALLOWED_HOSTS = config ('DJANGO_ALLOWED_HOSTS' , cast = Csv (), default = 'localhost' )
117+
118+ DATABASES = {
119+ 'default' : {
120+ 'ENGINE' : 'django.db.backends.postgresql' ,
121+ 'NAME' : config ('POSTGRES_DB' , default = 'taskflow' ),
122+ 'USER' : config ('POSTGRES_USER' , default = 'postgres' ),
123+ 'PASSWORD' : config ('POSTGRES_PASSWORD' , default = 'postgres' ),
124+ 'HOST' : config ('POSTGRES_HOST' , default = 'localhost' ),
125+ 'PORT' : config ('POSTGRES_PORT' , default = '5432' ),
126+ }
127+ }
128+
129+ CELERY_BROKER_URL = config ('CELERY_BROKER_URL' , default = 'amqp://guest:guest@localhost:5672//' )
0 commit comments