From 043193eda7dfece83e67fa4ab33140ca26e1d05a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 10 Dec 2024 18:38:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20base=20=E4=BD=BF=E7=94=A8=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=A4=84=E7=90=86session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/settings.py b/server/settings.py index 46fcc310..a4777c4f 100755 --- a/server/settings.py +++ b/server/settings.py @@ -221,6 +221,9 @@ REST_FRAMEWORK = { 'user': '200/second' } } +# session配置 +SESSION_ENGINE = 'django.contrib.sessions.backends.cache' + # simplejwt配置 SIMPLE_JWT = { 'ACCESS_TOKEN_LIFETIME': timedelta(days=7), From 9f052d1fdd237ac962e8335011d0acc935ef7dd6 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 10 Dec 2024 18:52:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20base=20=E4=BD=BF=E7=94=A8=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=A4=84=E7=90=86session=E5=8F=8Acsrf=E9=80=82?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server/settings.py b/server/settings.py index a4777c4f..9c375324 100755 --- a/server/settings.py +++ b/server/settings.py @@ -223,6 +223,7 @@ REST_FRAMEWORK = { } # session配置 SESSION_ENGINE = 'django.contrib.sessions.backends.cache' +CSRF_COOKIE_NAME = 'csrftoken' # simplejwt配置 SIMPLE_JWT = { From d349970a47504b30de38bcf2705fdedc51bd744e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 11 Dec 2024 08:41:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?doc:=20=E5=88=A0=E9=99=A4=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E5=88=86print=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/edu/views.py | 1 - apps/inm/services.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/apps/edu/views.py b/apps/edu/views.py index 990f3c99..c6fa69ef 100644 --- a/apps/edu/views.py +++ b/apps/edu/views.py @@ -124,7 +124,6 @@ class ExamViewSet(CustomModelViewSet): AnswerDetail.objects.bulk_create(details) sr = ExamRecordInitSerizlier(er) res_data = sr.data - print(res_data) res_data.update({"chance_used": chance_used}) return Response(sr.data, status=201) raise ParseError('暂不支持') diff --git a/apps/inm/services.py b/apps/inm/services.py index 77d6c6fd..12023589 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -337,8 +337,4 @@ def daoru_mb(path: str): material=material, batch=batch, warehouse=warehouse, defaults={"material": material, "batch": batch, "warehouse": warehouse, "count": count, "id": idWorker.get_id()} ) cal_material_count([material.id]) - # if not is_created: - # mb.count += count - # mb.save() - print(f"第{i}行数据导入成功") i = i + 1