diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a884af4..5722815 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,7 +35,7 @@ jobs: remote_key: ${{ secrets.KEY }} - name: executing remote ssh commands using password - uses: appleboy/ssh-action@develop + uses: appleboy/ssh-action@v0.1.0 with: host: ${{ secrets.HOST }} username: ubuntu diff --git a/accounts/models.py b/accounts/models.py index f43bd8b..fbf9ddc 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -16,7 +16,7 @@ class User(AbstractUser): default="default_profile_pic.jpg", upload_to="profile_pics" ) - reliability = models.IntegerField(default=100) + reliability = models.SmallIntegerField(default=100) USERNAME_FIELD = "email" REQUIRED_FIELDS = ["name"] diff --git a/mustgou/settings.py b/mustgou/settings.py index 3ef618c..e7913d0 100644 --- a/mustgou/settings.py +++ b/mustgou/settings.py @@ -41,6 +41,7 @@ "django.contrib.staticfiles", "rest_framework", "rest_framework.authtoken", + "corsheaders", "accounts", "friends", "restaurants", @@ -55,6 +56,7 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", + "corsheaders.middleware.CorsMiddleware", ] ROOT_URLCONF = "mustgou.urls" @@ -118,6 +120,31 @@ ] } +# CORS 관련 추가(모든 포트 허용) +CORS_ALLOW_ALL_ORIGINS = True + +# HTTP methods 추가 +CORS_ALLOW_METHODS = { + "DELETE", + "GET", + "OPTIONS", + "PATCH", + "POST", + "PUT", +} + +CORS_ALLOW_HEADERS = { + "accept", + "accept-encoding", + "authorization", + "content-type", + "dnt", + "origin", + "user-agent", + "x-csrftoken", + "x-requested-with", +} + # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/ diff --git a/requirements.txt b/requirements.txt index e11942c..bae6347 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,46 @@ asgiref==3.8.1 +blinker==1.4 +certifi==2024.7.4 +charset-normalizer==3.3.2 +cryptography==3.4.8 +dbus-python==1.2.18 +distro==1.7.0 +distro-info==1.1+ubuntu0.1 Django==4.2.14 +django-cors-headers==4.4.0 djangorestframework==3.15.2 -pillow==10.4.0 -pip==24.1.2 +gunicorn==22.0.0 +httplib2==0.20.2 +idna==3.7 +importlib-metadata==4.6.4 +jeepney==0.7.1 +keyring==23.5.0 +launchpadlib==1.10.16 +lazr.restfulclient==0.14.4 +lazr.uri==1.0.6 +more-itertools==8.10.0 mysqlclient==2.2.4 +netifaces==0.11.0 +oauthlib==3.2.0 +packaging==24.1 +pillow==10.4.0 +Pygments==2.11.2 +PyGObject==3.42.1 +PyJWT==2.3.0 +PyMySQL==1.1.1 +pyparsing==2.4.7 +python-apt==2.4.0+ubuntu3 python-decouple==3.8 +PyYAML==5.4.1 +requests==2.32.3 +SecretStorage==3.3.1 setuptools==70.0.0 +six==1.16.0 sqlparse==0.5.0 typing_extensions==4.12.2 -gunicorn==22.0.0 +ubuntu-advantage-tools==8001 +ufw==0.36.1 +unattended-upgrades==0.1 +urllib3==2.2.2 +wadllib==1.3.6 +zipp==1.0.0