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:
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user