Replace hardcoded values with environment variables in the Django settings files to enhance configurability and security.
Changes made:
Use settings.TIME_ZONE instead of hardcoded "Asia/Kolkata" in celery.py
Dynamically set DEBUG mode based on the DEBUG environment variable
Utilize environment variables for database connection details (DBPORTL)
Set TIME_ZONE from the TIME_ZONE environment variable or default to "Asia/Kolkata"
Configure CSRF_TRUSTED_ORIGINS and CORS_ALLOWED_ORIGINS using environment variables, allowing multiple origins to be specified
This change improves flexibility and ease of deployment by decoupling configuration from code, making it easier to manage the Django application across different environments.
Replace hardcoded values with environment variables in the Django settings files to enhance configurability and security.
Changes made:
settings.TIME_ZONE
instead of hardcoded "Asia/Kolkata" in celery.pyDEBUG
mode based on theDEBUG
environment variableTIME_ZONE
from theTIME_ZONE
environment variable or default to "Asia/Kolkata"CSRF_TRUSTED_ORIGINS
andCORS_ALLOWED_ORIGINS
using environment variables, allowing multiple origins to be specifiedThis change improves flexibility and ease of deployment by decoupling configuration from code, making it easier to manage the Django application across different environments.