def test_report_create(self): print("test_report_create") response = self.client.post(self.url, data={'title': 'hi', 'content': 'hello'}, **{'HTTP_AUTHORIZATION': self.access_token_1}) self.assertEqual(response.status_code, 200) 위와 같이 **을 붙여서 표현 하는데 이 때 'HTTP_'을 붙여서 표현하는 것이 중요하다. 참고글: https://ssamko.tistory.com/53 [Django] Test 코드 작성시 header 추가하기 Django를 API서버로만 이용할 때, 외부 사용자들에게 header를 통해 인증정보를..
1단계(설치) pip instll Pillow django djangorestframework 2단계(설치) django-admin startproject backend . django-admin startapp blog 3단계(settings.py) INSTALLED_APPS = [ ... 'django.contrib.sites', 'blog.apps.BlogConfig' ] MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 4단계(backend.urls.py) from django.contrib import admin from django.urls import path from django.urls.conf import includ..
- Total
- Today
- Yesterday
- ubuntu
- 백준
- docker-compose
- Collections
- 자바
- headers
- 프로그래머스
- thread
- 면접
- Celery
- 2021 KAKAO BLIND RECRUITMENT
- Spring
- docker
- Python
- PostgreSQL
- setattr
- django
- Pattern
- dockerignore
- postgres
- BFS
- 파이썬
- env
- Java
- Linux
- 알고리즘
- DRF
- 카카오
- 그래프
- Command Line
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |