From 0cffc3926d3b0ff0ff4a4e69ecce61b8de675266 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 30 Jan 2026 23:29:47 +0545 Subject: [PATCH] feat(djinit/templates/project): default DJANGO_SETTINGS_MODULE to project production settings Set the default DJANGO_SETTINGS_MODULE environment variable to point to the production settings module derived from the project name, ensuring the Django management script runs with the correct configuration when no explicit DJANGO_SETTINGS_MODULE is provided. New Features - Automatically default the DJANGO_SETTINGS_MODULE to `.settings.production`, simplifying project setup. Enhancements - Improves the management script initialization by providing a sensible production settings fallback. Bug Fixes - None. --- djinit/templates/project/manage_py.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djinit/templates/project/manage_py.j2 b/djinit/templates/project/manage_py.j2 index 079cfdc..b6a20b7 100644 --- a/djinit/templates/project/manage_py.j2 +++ b/djinit/templates/project/manage_py.j2 @@ -11,7 +11,7 @@ import environ def main(): """Run administrative tasks.""" - os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.getenv("DJANGO_SETTINGS_MODULE")) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.getenv("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.production")) try: from django.core.management import execute_from_command_line