diff --git a/adaptive_hockey_federation/core/config/base_settings.py b/adaptive_hockey_federation/core/config/base_settings.py index ba753a99..20d55d64 100644 --- a/adaptive_hockey_federation/core/config/base_settings.py +++ b/adaptive_hockey_federation/core/config/base_settings.py @@ -1,4 +1,5 @@ from pathlib import Path +from re import DEBUG import environ from django.contrib.messages import constants as messages diff --git a/adaptive_hockey_federation/core/config/dev_settings.py b/adaptive_hockey_federation/core/config/dev_settings.py index 446035cb..89eae34e 100644 --- a/adaptive_hockey_federation/core/config/dev_settings.py +++ b/adaptive_hockey_federation/core/config/dev_settings.py @@ -1,4 +1,4 @@ -from . base_settings import * +from .base_settings import * ROOT_DIR = BASE_DIR.parent diff --git a/adaptive_hockey_federation/manage.py b/adaptive_hockey_federation/manage.py index d730851a..cb57f050 100644 --- a/adaptive_hockey_federation/manage.py +++ b/adaptive_hockey_federation/manage.py @@ -3,12 +3,28 @@ import os import sys +import environ + +from adaptive_hockey_federation.core.config.base_settings import BASE_DIR + +env = environ.Env() + + +env.read_env(BASE_DIR.parent / ".env") + +DEBUG = os.environ.get("DEBUG") + + +print(f"{DEBUG=}") + +switch_prod_dev = {"True": "dev", "False": "prod"} +print(switch_prod_dev[str(DEBUG)]) def main(): """Run administrative tasks.""" os.environ.setdefault("DJANGO_SETTINGS_MODULE", - "core.config.prod_settings") + f"core.config.{switch_prod_dev[str(DEBUG)]}_settings") try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/requirements/production.txt b/requirements/production.txt index b28b80a2..94721d7e 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -9,6 +9,7 @@ click-repl==0.3.0 ; python_version >= "3.11" and python_version < "4.0" click==8.1.7 ; python_version >= "3.11" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32") django-environ==0.11.2 ; python_version >= "3.11" and python_version < "4" +django-extensions==3.2.3 ; python_version >= "3.11" and python_version < "4.0" django-phonenumber-field[phonenumbers]==7.3.0 ; python_version >= "3.11" and python_version < "4.0" django==4.2.13 ; python_version >= "3.11" and python_version < "4.0" djangorestframework==3.15.2 ; python_version >= "3.11" and python_version < "4.0"