Skip to content

Commit

Permalink
chore: cd 워크플로우 생성
Browse files Browse the repository at this point in the history
github actions와 docker을 활용하여 cd
  • Loading branch information
ybkang1108 committed Jul 30, 2024
1 parent ba58407 commit 568d2b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ env/
db.sqlite3
.DS_Store
.env
.env.prod
venv/
mguvenv/
2 changes: 1 addition & 1 deletion accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class User(AbstractUser):
reliability = models.IntegerField(default=100)

USERNAME_FIELD = "email"
REQUIRED_FIELDS = []
REQUIRED_FIELDS = ["name"]

def __str__(self):
return self.name
2 changes: 1 addition & 1 deletion accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create(self, validated_data):

# 로그인 시리얼라이저
class LoginSerializer(serializers.Serializer):
username = serializers.EmailField(required=True)
email = serializers.EmailField(required=True)
# write_only=True 를 통해 클라이언트->서버 만 가능하도록 설정
password = serializers.CharField(required=True, write_only=True)

Expand Down
7 changes: 4 additions & 3 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class LoginView(generics.GenericAPIView):

def post(self, request):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
token = serializer.validated_data
return Response({"token": token.key}, status=status.HTTP_200_OK)
if serializer.is_valid():
token = serializer.validated_data
return Response({"token": token.key}, status=status.HTTP_200_OK)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

0 comments on commit 568d2b0

Please sign in to comment.