From 2efa1fed5509942712ef0f67b719e991d7e9cef9 Mon Sep 17 00:00:00 2001 From: EnLiao Date: Thu, 2 Oct 2025 11:48:40 +0800 Subject: [PATCH 1/3] chore: add install apps to setting.py --- back_end/__pycache__/settings.cpython-310.pyc | Bin 2234 -> 2675 bytes back_end/settings.py | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/back_end/__pycache__/settings.cpython-310.pyc b/back_end/__pycache__/settings.cpython-310.pyc index 63e83be9599902b2d106df3f477eca7c0e9ad281..d40a5bfd35b1b68a913986ec6d02eb63da94ba7f 100644 GIT binary patch delta 850 zcmYLGTWb?R6rP#g?QU+{rdPGGt#<-VX?;+TQZG$VR9Y}maZtiGXH2%;&BmFHLQyKz zKOh00d`NurP4Pv*odpQag;h2eC9{28@qF7ILqKuUr@%?6LkBj16cRlX)KU+-(w` zZxR@PNBKDN1o8w-@=2INFAvj*Gw-NR;mBLFN%<5U<;1nNRr)%)vaq znS+G`JaK?0ecCkn5je$x4w4d&pONcsKzIk=y`ewacxpw!uHfypgv>7LuKfI|{*6&nm^;?w(yVD?^ zmi)F7jjj}>M$2nAMJW^w9RI(?&@%C?lQlwA0j(x^P9CLS(C4&I21K$Uzh+NZmAog| zmZf6pcZy82rDaW9GKEPp)jR2|R?@41ui{1&cGl)Fs*>sjB3&e%yL$Wf=KV^!eq*y* ztL{#$oWHoVjC*A7tqhBT7U$WR7p_Gav2X{0F~Tn)z>no9=Jq`M^ZMbG&>dR2q^PqRM$iq!TB3-$hhUOy)}dM4V@8%vI$2tvreQM2 Ka`L^G&ZWP??B=xq delta 408 zcmW+y%TB^j6uh^+rKPq=5kbWb=)x{ophm?gzGx(BG!cyPE^L6)lr}sR1Ron0et~J? z%7q$Z;+loVKkyUm7r6Hayn2$E$(%XKN#-Z|p@mwiDkC;u1;1u0x1sUt7v=y_1Q@tF zZg7;t$l@&i20xHT7X$_+PX4t_tp<#$o4dOJy-VHHCVT2CDD2>5b z5$TEkB3{9pSL@)Gn|3ShG&@$c+qTm4N!LBEfYX?puQ;8v)yk}SIhkqHdgX-Y}eUhM3AC{c_I>?aFQSey{x?W3xC{bEC2ui 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 = [ From 805495e94551750e6ce69eda4249011eb3485a1d Mon Sep 17 00:00:00 2001 From: EnLiao Date: Thu, 2 Oct 2025 12:06:31 +0800 Subject: [PATCH 2/3] chore: add .patch at gitignore --- .gitignore | 3 ++- diff.patch | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 diff.patch 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/diff.patch b/diff.patch new file mode 100644 index 0000000..22498ef --- /dev/null +++ b/diff.patch @@ -0,0 +1,47 @@ +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 @@ https://docs.djangoproject.com/en/5.2/ref/settings/ + """ + + 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 @@ INSTALLED_APPS = [ + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', ++ "rest_framework", ++ "corsheaders", ++ "user", ++ "courses", ++ "auths", ++ "problems", ++ "assignments", ++ "submissions", + ] + + MIDDLEWARE = [ From e38f6fb6c36ad7728b70259b1403007437d2598f Mon Sep 17 00:00:00 2001 From: EnLiao Date: Thu, 2 Oct 2025 12:08:12 +0800 Subject: [PATCH 3/3] chore: delete patch --- diff.patch | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 diff.patch diff --git a/diff.patch b/diff.patch deleted file mode 100644 index 22498ef..0000000 --- a/diff.patch +++ /dev/null @@ -1,47 +0,0 @@ -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 @@ https://docs.djangoproject.com/en/5.2/ref/settings/ - """ - - 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 @@ INSTALLED_APPS = [ - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -+ "rest_framework", -+ "corsheaders", -+ "user", -+ "courses", -+ "auths", -+ "problems", -+ "assignments", -+ "submissions", - ] - - MIDDLEWARE = [