Adding information to our model from django.db import models from pygments.lexers import get_all_lexers, get_lexer_by_name from pygments.styles import get_all_styles from pygments.formatters.html import HtmlFormatter from pygments import highlight LEXERS = [item for item in get_all_lexers() if item[1]] LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in LEXERS]) STYLE_CHOICES = sorted([..
인증체계? request.user: 사용자 모델 인스턴스. django.contrib.auth.User requet.auth: 인증 토큰과 같은 추가 인증 정보 Django Rest Framwork는 rest_framework.authentication 모듈에서 다음 세 가지 인증 클래스를 제공. 모두 BaseAuthentication 클래스의 서브 클래스. BasicAuthentication: 사용자 이름과 암호에 대한 HTTP 기본 인증을 제공한다. 제품으로 사용하는 경우에는 API가 HTTPS에서만 사용 가능해야 한다. SessionAuthentication: 인증을 위해 장고의 세션 프레임워크와 함께 작동 TokenAuthentication: 간단한 토큰 기반 인증을 제공. 요청에는 토큰의 접두어..