1- """
2- Django settings for taskflow_api project.
3-
4- Generated by 'django-admin startproject' using Django 5.2.1.
5-
6- For more information on this file, see
7- https://docs.djangoproject.com/en/5.2/topics/settings/
8-
9- For the full list of settings and their values, see
10- https://docs.djangoproject.com/en/5.2/ref/settings/
11- """
12-
1+ import os
132from pathlib import Path
3+ from decouple import config , Csv
144
155# Build paths inside the project like this: BASE_DIR / 'subdir'.
166BASE_DIR = Path (__file__ ).resolve ().parent .parent
199# Quick-start development settings - unsuitable for production
2010# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
2111
22- # SECURITY WARNING: keep the secret key used in production secret!
23- SECRET_KEY = 'django-insecure-%ih9li)=no$9s=93us((337b-79ya*%psbm)=0(csy^$c*qg%^'
24-
25- # SECURITY WARNING: don't run with debug turned on in production!
26- DEBUG = True
27-
28- ALLOWED_HOSTS = []
29-
3012
3113# Application definition
3214
7961WSGI_APPLICATION = 'taskflow_api.wsgi.application'
8062
8163
82- # Database
83- # https://docs.djangoproject.com/en/5.2/ref/settings/#databases
84-
85- DATABASES = {
86- 'default' : {
87- 'ENGINE' : 'django.db.backends.sqlite3' ,
88- 'NAME' : BASE_DIR / 'db.sqlite3' ,
89- }
90- }
91-
92-
9364# Password validation
9465# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
9566
137108# MANUALLY ADDED
138109
139110CORS_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