1. error 해결법 setattr로 해결하기 사용법 setattr(obj,key,value) 만일 독자가 obj[key]=value 형식으로 했는데 제목과 같은 에러가 난다면 위와 같이 "setattr"로 해결해보는 것도 좋은 판단이다. 참고: https://stackoverflow.com/questions/8542343/object-does-not-support-item-assignment-error Object does not support item assignment error In my views.py I assign values before saving the form. I used to do it the following way: projectForm.lat = session_results..
1. docker-compose.yml 파일 version: "3" services: nginx: container_name: nginx build: ./nginx restart: always ports: - "7070:80" volumes: - ./backend/entry:/srv/code/entry - ./log:/var/log/nginx depends_on: - web db: image: postgres container_name: main.postgres restart: always environment: POSTGRES_DATABASE: "${DB_NAME}" POSTGRES_USER: "${DB_USER}" POSTGRES_PASSWORD: "${DB_PASSWORD}" ports: - "70..
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를 통해 인증정보를..
def test_report_create(self): print("test_report_create") access_token = self.common_report_create({"email": "12@kakao.com", "password": "django_kakao_test"}) response = RequestsClient().post('http://127.0.0.1:8000/api/report', data={'title': 'hi', 'content': 'hello'}, headers={'Authorization': access_token}) self.assertEqual(response.status_code, 200) response = self.client.post(url, data={'con..
python -m venv env 우선 가상환경 먼저 세팅을 해준다. 가상환경 작동하는 방법은 " .\env\Scripts\activate " 입니다. pip install django djangorestframework requests 설치 할 것은 위와 같다. django-admin startproject backend . django-admin startapp accounts 그 다음 카카오 시크릿 키와 장고 안에 기본적으로 가지고 있는 시크릿 키를 json파일로 옮기는 작업을 해줘야 한다. settings.py import os import json secret_file = os.path.join(BASE_DIR, "secrets.json") secrets = None with open(secre..
- Total
- Today
- Yesterday
- 프로그래머스
- 백준
- docker-compose
- 알고리즘
- Pattern
- Spring
- 파이썬
- Linux
- ubuntu
- django
- Celery
- 2021 KAKAO BLIND RECRUITMENT
- postgres
- Collections
- Command Line
- env
- Python
- setattr
- 면접
- BFS
- dockerignore
- Java
- 자바
- headers
- docker
- PostgreSQL
- 카카오
- DRF
- 그래프
- thread
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |