diff --git a/.gitignore b/.gitignore index 3c8a5fc..5031041 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ staticfiles/ .idea/ .DS_Store Thumbs.db -.env \ No newline at end of file +.env +.patch \ No newline at end of file diff --git a/back_end/__pycache__/settings.cpython-310.pyc b/back_end/__pycache__/settings.cpython-310.pyc index 63e83be..d40a5bf 100644 Binary files a/back_end/__pycache__/settings.cpython-310.pyc and b/back_end/__pycache__/settings.cpython-310.pyc differ diff --git a/back_end/settings.py b/back_end/settings.py index e0ff5af..60065df 100644 --- a/back_end/settings.py +++ b/back_end/settings.py @@ -11,16 +11,23 @@ """ from pathlib import Path +import os +from datetime import timedelta +from dotenv import load_dotenv # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +load_dotenv(BASE_DIR / ".env") # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-7!jjwbdim67bist@b4_y$1mhva8x=v(1h$yaqv2!@391)#ji^e' +# SECRET_KEY = 'django-insecure-7!jjwbdim67bist@b4_y$1mhva8x=v(1h$yaqv2!@391)#ji^e' +DEBUG = os.getenv("DJANGO_DEBUG", "True").lower() == "true" +SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "dev-insecure-change-me") +ALLOWED_HOSTS = [h.strip() for h in os.getenv("ALLOWED_HOSTS", "127.0.0.1,localhost").split(",") if h.strip()] # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -37,6 +44,14 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + "rest_framework", + "corsheaders", + "user", + "courses", + "auths", + "problems", + "assignments", + "submissions", ] MIDDLEWARE = [