mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:11:08 -05:00
refactor: Update environment variable handling in Django settings for consistency and security
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from decouple import config
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
# Auto-detect environment based on command line arguments and environment variables
|
||||
settings_module = detect_settings_module()
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
|
||||
config('DJANGO_SETTINGS_MODULE', settings_module)
|
||||
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
Reference in New Issue
Block a user