From b67765c93895b3b27baef4d42d82d71f20de37f0 Mon Sep 17 00:00:00 2001 From: lsjmc0224 Date: Mon, 27 May 2024 01:00:01 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:sparkles:=20Feat=20:=20=EB=B3=B4=EC=95=88?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 6 ++++++ .idea/2024_spring_festival_back_re.iml | 8 ++++++++ .idea/dataSources.xml | 12 ++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ festival/settings.py | 25 +++++++++++++++++++++++-- 6 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/2024_spring_festival_back_re.iml create mode 100644 .idea/dataSources.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..fc9d6ed --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,6 @@ +# 디폴트 무시된 파일 +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/2024_spring_festival_back_re.iml b/.idea/2024_spring_festival_back_re.iml new file mode 100644 index 0000000..0399c4b --- /dev/null +++ b/.idea/2024_spring_festival_back_re.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..0946264 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://172.17.0.2:5432/postgres + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..457605a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/festival/settings.py b/festival/settings.py index 9263a9d..95d46c6 100644 --- a/festival/settings.py +++ b/festival/settings.py @@ -40,7 +40,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - + 'corsheaders', + # drf app 'rest_framework', 'django_filters', @@ -56,6 +57,7 @@ ] MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -176,4 +178,23 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') \ No newline at end of file +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + +# security +REST_FRAMEWORK = { + 'DEFAULT_RENDERER_CLASSES': ( + # 'rest_framework.renderers.BrowsableAPIRenderer', + 'rest_framework.renderers.JSONRenderer', + ), + 'DEFAULT_THROTTLE_CLASSES': [ + 'rest_framework.throttling.AnonRateThrottle', + 'rest_framework.throttling.UserRateThrottle', + 'rest_framework.throttling.ScopedRateThrottle', + ], + 'DEFAULT_THROTTLE_RATES': { + 'anon': '1000/minute', + 'user' : '1000/hour', + 'comments' : '10/minute', + 'likes': '100/minute', + } +} \ No newline at end of file From 33b6622a94a7d1797f1f0105f3ee5a9dd37b5bf9 Mon Sep 17 00:00:00 2001 From: lsjmc0224 Date: Mon, 27 May 2024 01:02:59 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:sparkles:=20Feat=20:=20requirements.txt?= =?UTF-8?q?=EC=97=90=20corsheader=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index d6a0524..58ef549 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ asgiref==3.8.1 certifi==2024.2.2 charset-normalizer==3.3.2 Django==5.0.4 +django-cors-headers==4.3.1 django-filter==24.2 djangorestframework==3.15.1 idna==3.7 From 5e6c2f12b1f71664ee1a7b102d6f710598aea538 Mon Sep 17 00:00:00 2001 From: lsjmc0224 Date: Mon, 27 May 2024 01:04:55 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:memo:=20Chore=20:=20.idea=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 6 ------ .idea/2024_spring_festival_back_re.iml | 8 -------- .idea/dataSources.xml | 12 ------------ .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 5 files changed, 40 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/2024_spring_festival_back_re.iml delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index fc9d6ed..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# 디폴트 무시된 파일 -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/2024_spring_festival_back_re.iml b/.idea/2024_spring_festival_back_re.iml deleted file mode 100644 index 0399c4b..0000000 --- a/.idea/2024_spring_festival_back_re.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index 0946264..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://172.17.0.2:5432/postgres - $ProjectFileDir$ - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 457605a..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file