-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database #77
Database #77
Conversation
Feat/database edit
설정관련 파일 배포용으로
migration 파일 변경
- 시간 Asia/Seoul 로 변경 - 리디렉션 url 변경
- serializer에 date 추가 - date 받아와서 datetime으로 전환 - 오늘투두 조회시 시간 asia/seoul로 변경
- 시리얼라이저 필드에 user__id -> id
- 유저 스택 생성 시 stack_id 만 입력 - 유저 스택 삭제 시 request로 user_stack_id 필요
Feat/database edit
@@ -143,7 +143,7 @@ | |||
|
|||
# 국제화 설정 | |||
LANGUAGE_CODE = "en-us" | |||
TIME_ZONE = "UTC" | |||
TIME_ZONE = "Asia/Seoul" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
배포용으로 바꾸신거죠?
} | ||
} | ||
|
||
SOCIALACCOUNT_LOGIN_ON_GET = True | ||
LOGIN_REDIRECT_URL = "https://d3hcv7ngm54uy8.cloudfront.net/oauth-callback" | ||
ACCOUNT_LOGOUT_REDIRECT_URL = "https://d3hcv7ngm54uy8.cloudfront.net/landing" | ||
LOGIN_REDIRECT_URL = "/oauth-callback/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
클라우드 프론드 대신에 엔드포인트 추가
@@ -2,17 +2,17 @@ | |||
from django.urls import include, path | |||
|
|||
urlpatterns = [ | |||
path("admin/", admin.site.urls), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엔드포인트 앞에 api 명시해서 우선순위 구분
|
||
except DatabaseError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예외처리..?
path( | ||
"todos/<int:pk>/undone/", TodoMarkUndoneView.as_view(), name="todo-mark-undone" | ||
), | ||
path("<int:id>/update/", TodoUpdateView.as_view()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아이디 추가
def get_queryset(self): | ||
return super().get_queryset().filter(user=self.request.user) | ||
|
||
def perform_update(self, serializer): | ||
date_str = self.request.data.get("date") | ||
try: | ||
date = datetime.strptime(date_str, "%Y-%m-%d").date() | ||
# datetime 객체 생성 (시간은 00:00:00으로 설정) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간설정
serializer.save(user=request.user) # request.user 사용 | ||
return Response(serializer.data, status=status.HTTP_201_CREATED) | ||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) | ||
def post(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post내용에 스택 아이디 추가
분리된 환경 통합