Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ staticfiles/
.idea/
.DS_Store
Thumbs.db
.env
.env
.patch
Binary file modified back_end/__pycache__/settings.cpython-310.pyc
Binary file not shown.
17 changes: 16 additions & 1 deletion back_end/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,6 +44,14 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
"rest_framework",
"corsheaders",
"user",
"courses",
"auths",
"problems",
"assignments",
"submissions",
]

MIDDLEWARE = [
Expand Down