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 `<project_name>.settings.production`, simplifying project setup.

Enhancements
- Improves the management script initialization by providing a sensible production settings fallback.

Bug Fixes
- None.
This commit is contained in:
sankalp committed 2026-01-30 23:29:47 +05:45
1 parent eedb3e3677
commit 0cffc3926d
1 file changed
+1 -1
+1 -1
View File
@@ -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