후에 공부

dooh kim·2020년 4월 3일
0

https://kubernetes.io/ko/docs/tutorials/kubernetes-basics/

https://jupiny.com/2016/12/12/sort-korean-in-postgresql/
jupiny의 개발일지jupiny의 개발일지
PostgreSQL 한글 정렬 문제 해결하기

[PostgreSQL] psql 명령어

drf-yasg참조
https://mashup.lhy.kr/doc/
https://github.com/LeeHanYeong/Mash-Up-Backend
GitHubGitHub
LeeHanYeong/Mash-Up-Backend

https://drf-yasg.readthedocs.io/en/stable/

alias typora="open -a /Applications/Typora.app/Contents/MacOS/Typora"

PostListCreateAPIView를 generics.ListCreateAPIView를 상속받도록 수정
PostImageCreateSerializer구현 및 사용
PostCreateSerializer가 Post와 PostImage를 동시에 생성할 수 있도록 설정

/posts/?published=1
/posts/?published=0
request.GET

Django view
로그인

  • 클라이언트가 username/password를 로그인을 처리할 view에 전송
  • 로그인을 처리하는 view는 받은 username/password(자격증명)을 이용해서 해당 유저가 있는지 확인
  • 있다면, 그 유저를 특정할 수 있는 Session값을 django_sessions테이블에 생성
    해당 내용을 Set-Cookie헤더에 담아서(key: sessionid) 클라이언트에게 보내줌
  • 클라이언트는 받은 sessionid쿠키를 로컬 영역에 저장
    이후 다시 요청을 보낼 때 마다 해당 쿠키를 담아서 보냄
    DRF
  • 클라이언트가 username/password를 토큰을 발급할 view에 전송
  • 토큰발급을 처리하는 view는 받은 username/password(자격증명)을 이용해서 해당유저가 있는지 확인
  • 있다면, 그 유저를 특정할 수 있는 Token을 authtoken테이블에 생성
    해당 내용을 Response에 담아서 JSON형태로 클라이언트에게 보내줌
  • 클라이언트는 받은 token값을 로컬 영역에 저장
    이후 다시 요청을 보낼 때 마다, Header의 Authorization키에 Token <값>으로 담아 보냄

Serialize
메모리에 갖고 있는 비연속적인 데이터를 연속적인 데이터로 만드는 과정
파일, 문자열
Deserialize
연속적인 데이터를 파이썬이 사용하는 데이터 형태로 만드는 과정
Serialize과정
Custom Python object
-> (Serializer) -> Python data type
-> (Renderer) -> JSON
serializer = SnippetSerializer(snippet)
snippet: Custom Python object
serializer: snippet object를 Python data type으로 변환할 수 있는 Serializer객체
-> .data (snippet object를 Python data type으로 가져오는 property)
Deserialize과정
JSON string
-> (Parser) -> Python data type
-> (Serializer) -> Custom object(Model instance)
(create / update)
Create (data)
title, code, linenos, style, language
Update (instance, data)
title, code

profile
testify to the light

0개의 댓글