Skip to content

Commit

Permalink
feat: 에러 해결 및 api url 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kynzun committed Nov 26, 2021
1 parent a4b2042 commit de8eade
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
9 changes: 5 additions & 4 deletions account/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.urls import path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from .views import RegisterAPIView
from .views import RegisterAPIView, TestAPIView

urlpatterns = [
path("api/signin", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("signin", TokenObtainPairView.as_view(), name="token_obtain_pair"),
# 세션 연장하고 싶을 때 refresh token 사용
# path("api/token/refresh", TokenRefreshView.as_view(), name="token_refresh"),
path("api/signup", RegisterAPIView.as_view()),
# path("token/refresh", TokenRefreshView.as_view(), name="token_refresh"),
path("signup", RegisterAPIView.as_view()),
path("test", TestAPIView.as_view()),
]
9 changes: 8 additions & 1 deletion account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ def post(self, request):
},
status=status.HTTP_201_CREATED,
)
return Response(user_serializer.errors, status=status.HTTP_400_BAD_REQUEST)
return Response(user_serializer.errors, status=status.HTTP_400_BAD_REQUEST)


class TestAPIView(APIView):
def get(self, request):
return Response(
{"message": "test API successfully responsed"}, status=status.HTTP_200_OK
)
4 changes: 4 additions & 0 deletions config/docker/entrypoint.prod.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

echo "Collect static files"
python manage.py collectstatic --no-input

echo "Apply database migrations"
python manage.py migrate

exec "$@"
3 changes: 1 addition & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: '3.8'
version: "3.8"
services:

web:
container_name: web
build:
Expand Down
2 changes: 1 addition & 1 deletion vote_mailedit/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

urlpatterns = [
path("admin/", admin.site.urls),
path("account/", include("account.urls")),
path("api/", include("account.urls")),
]

if base.DEBUG:
Expand Down

0 comments on commit de8eade

Please sign in to comment.