소스코드는 어디에 있을까요??
해결됨
[리뉴얼] 처음하는 파이썬 백엔드와 웹기술 입문 (파이썬 중급, flask[플라스크] 로 이해하는 백엔드 및 웹기술 기본) [풀스택 Part1-1]
강의 듣는 중에 소스나 참고자료는 어디서 다운로드 받을 수 있을까요? ㅎㅎ
- python
- rest-api
- flask
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
[리뉴얼] 처음하는 파이썬 백엔드와 웹기술 입문 (파이썬 중급, flask[플라스크] 로 이해하는 백엔드 및 웹기술 기본) [풀스택 Part1-1]
강의 듣는 중에 소스나 참고자료는 어디서 다운로드 받을 수 있을까요? ㅎㅎ
미해결
[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
다른 ko, ja, ch 는 모두 동작하지만 Accept-Language를 설정하지 않거나 Accept-Language를 en으로 설정하여도 계속 안녕하세요 한글이 나오고 있습니다. 무슨 문제일까요..? https://github.com/KMSKang/my-restful-service
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
안녕하세요! 강사님 강의 잘 듣고 있습니다. 섹션 19. 17-01 강의를 따라하고 있는데 쉘에 깃클론 -> 환경변수 파일 만들고 -> 도커 컴포즈 빌드 -> 도커 컴포즈 업 이렇게 명령어를 따라갔는데 로그가 너무 오래 찍히더라구요! 무슨일인가 싶어 일단 취소하고 docker ps -a 명령어로 확인해봤더니 서버가 만들어지고 꺼진 것 같더라구요 해당 image 아이디를 가지고 docker logs 를 봤는데 위와 같은 메세지가 나옵니다. 검색해봤더니 nest/cli를 devDependencies 에서 빼고 dependencies 에 넣으라고 해서 그렇게 했는데도 오류는 동일하게 나오네요 ㅠㅠ 혹시 몰라 도커파일에 RUN npm install @nestjs/cli 를 추가해봤는데 이번에는 swagger pluginrs 가 설치되지 않았다는 오류가 나옵니다. 어떻게 하면 좋을까요??
미해결
Java 마이크로서비스(MSA) 프로젝트 실습
prometheus 와 WMI exporter 연동이 왜 안되는지 모르겠습니다. global: scrap_interval: 15s evaluation_interval: 15s scrape_configs: - job_name: "prometheus" static_configs: - targets: ["localhost:9090"] - job_name: "windows" static_configs: - targets: ["192.168.0.101:9182"] 위와같이 제 pc의 ip를 192.168.0.101로 설정했습니다. cmd창에서 확인한 것입니다. PS D:\study-workspace\springBoot-workspace\iron-msa> ipconfig Windows IP 구성 이더넷 어댑터 vEthernet (Default Switch): 연결별 DNS 접미사. . . . : 링크-로컬 IPv6 주소 . . . . : fe80::2609:80c8:ea62:2e07%31 IPv4 주소 . . . . . . . . . : 192.168.16.1 서브넷 마스크 . . . . . . . : 255.255.240.0 기본 게이트웨이 . . . . . . : 이더넷 어댑터 이더넷: 연결별 DNS 접미사. . . . : 링크-로컬 IPv6 주소 . . . . : fe80::f3d1:5994:1b9d:5bf8%9 IPv4 주소 . . . . . . . . . : 192.168.0.101 서브넷 마스크 . . . . . . . : 255.255.255.0 기본 게이트웨이 . . . . . . : 192.168.0.1 연결별 DNS 접미사. . . . : 이더넷 어댑터 vEthernet (WSL): 연결별 DNS 접미사. . . . : 링크-로컬 IPv6 주소 . . . . : fe80::a35b:8530:2f6d:4eb9%38 IPv4 주소 . . . . . . . . . : 172.18.0.1 서브넷 마스크 . . . . . . . : 255.255.240.0 기본 게이트웨이 . . . . . . : 아래는 혹시 ip를 잘못지정한 것일까봐 확인한 것입니다. 도와주실 수 있나요
미해결
실전! FastAPI 입문
from typing import List from fastapi import FastAPI, Body, HTTPException, Depends from pydantic import BaseModel from sqlalchemy.orm import Session from database.orm import ToDo from database.connection import get_db from database.repository import get_todos from schema.response import ListToDoResponse, ToDoSchema app = FastAPI() @app.get("/") def heath_check_handler(): return {"ping": "pong"} todo_data = { 1: { "id": 1, "contents": "실전! FastAPI 섹션 0 수강", "is_done": True, }, 2: { "id": 2, "contents": "실전! FastAPI 섹션 1 수강", "is_done": False, }, 3: { "id": 3, "contents": "실전! FastAPI 섹션 2 수강", "is_done": False, }, } @app.get("/todos", status_code=200) def get_todos_handler( order: str | None = None, session: Session = Depends(get_db), ) -> ListToDoResponse: todos: List[ToDo] = get_todos(session=session) if order and order == "DESC": return ListToDoResponse( todos=[ToDoSchema.from_orm(todo) for todo in todos[::-1]] ) return ListToDoResponse( todos=[ToDoSchema.from_orm(todo) for todo in todos] ) @app.get("/todos/{todo_id}", status_code=200) def get_todo_handler(todo_id: int): todo = todo_data.get(todo_id) if todo: return todo raise HTTPException(status_code=404, detail="ToDo Not Found") class CreateToDoRequest(BaseModel): id: int contents: str is_done: bool @app.post("/todos", status_code=201) def create_todo_handler(request: CreateToDoRequest): todo_data[request.id] = request.dict() return todo_data[request.id] @app.patch("/todos/{todo_id}", status_code=200) def update_todo_handler( todo_id: int, is_done: bool = Body(..., embed=True) ): todo = todo_data.get(todo_id) if todo: todo["is_done"] = is_done return todo raise HTTPException(status_code=404, detail="ToDo Not Found") @app.delete("/todos/{todo_id}") def delete_todo_handler(todo_id: int): todo = todo_data.pop(todo_id, None) if todo: return raise HTTPException(status_code=404, detail="ToDo Not Found") from typing import List from pydantic import BaseModel class ToDoSchema(BaseModel): id: int contents: str is_done: bool class Config: orm_mode = True class ListToDoResponse(BaseModel): todos: List[ToDoSchema] from typing import List from sqlalchemy import select from sqlalchemy.orm import Session from database.orm import ToDo def get_todos(session: Session) -> List[ToDo]: return list(session.scalars(select(ToDo))) from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker DATABASE_URL = "mysql+pymysql://root:todos@127.0.0.1:3306/todos" engine = create_engine(DATABASE_URL, echo=True) SessionFactory = sessionmaker(autocommit=False, autoflush=False, bind=engine) def get_db(): session = SessionFactory() try: yield session finally: session.close() from sqlalchemy import Boolean, Column, Integer, String from sqlalchemy.orm import declarative_base Base = declarative_base() class ToDo(Base): __tablename__ = 'todo' id = Column(Integer, primary_key=True, index=True) contents = Column(String(256), nullable=False) is_done = Column(Boolean, nullable=False) def __repr__(self): return f"ToDo(id={self.id}, contents={self.contents}, is_done={self.is_done})" 에러가 납니다. 파이썬 콘솔 <input>:1: PydanticDeprecatedSince20: The from_orm method is deprecated; from schema.response import ToDoSchema from datagbase.orm import ToDo Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode coro = func() ^^^^^^ File "<input>", line 1, in <module> File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'datagbase' from database.orm import ToDo todo = ToDo(id=100, contents="test", is_done=True) ToDoSchema.from_orm(todo) <input>:1: PydanticDeprecatedSince20: The from_orm method is deprecated; set model_config['from_attributes']=True and use model_validate instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode coro = func() ^^^^^^ File "<input>", line 1, in <module> File "C:\Users\manag\pyProject\todos\Lib\site-packages\typing_extensions.py", line 2499, in wrapper return arg(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\pydantic\main.py", line 1126, in from_orm raise PydanticUserError( pydantic.errors.PydanticUserError: You must set the config attribute from_attributes=True to use from_orm http://localhost:8000/docs#/default/get_todos_handler_todos_get 접속시 터미널 INFO: 127.0.0.1:56312 - "GET /docs HTTP/1.1" 200 OK INFO: 127.0.0.1:56312 - "GET /openapi.json HTTP/1.1" 200 OK 2024-01-23 16:06:15,108 INFO sqlalchemy.engine.Engine BEGIN (implicit) 2024-01-23 16:06:15,109 INFO sqlalchemy.engine.Engine SELECT todo.id, todo.contents, todo.is_done FROM todo 2024-01-23 16:06:15,109 INFO sqlalchemy.engine.Engine [cached since 826.5s ago] {} 2024-01-23 16:06:15,113 INFO sqlalchemy.engine.Engine ROLLBACK INFO: 127.0.0.1:56312 - "GET /todos HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\manag\pyProject\todos\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\fastapi\applications.py", line 1054, in call await super().__call__(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\middleware\errors.py", line 186, in call raise exc File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\middleware\errors.py", line 164, in call await self.app(scope, receive, _send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\_exception_handler.py", line 64, in wrapped_app raise exc File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\routing.py", line 782, in app await route.handle(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\routing.py", line 297, in handle await self.app(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\_exception_handler.py", line 64, in wrapped_app raise exc File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\fastapi\routing.py", line 299, in app raise e File "C:\Users\manag\pyProject\todos\Lib\site-packages\fastapi\routing.py", line 294, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\fastapi\routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\starlette\concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\anyio\_backends\_asyncio.py", line 2134, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\anyio\_backends\_asyncio.py", line 851, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\src\main.py", line 48, in get_todos_handler todos=[ToDoSchema.from_orm(todo) for todo in todos] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\typing_extensions.py", line 2499, in wrapper return arg(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manag\pyProject\todos\Lib\site-packages\pydantic\main.py", line 1126, in from_orm raise PydanticUserError( pydantic.errors.PydanticUserError: You must set the config attribute from_attributes=True to use from_orm
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
@Field 하면 어떠한 객체에 있는것에 있는 Field 를 가져다 쓸거야~ 라고 말하면서 그러한 함수를 불러오는 건가요?? ㄷ
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
아무리 찾아봐도 웹에서 해결하는 것이 불가능해서 postman desktop 까는 것을 추천드립니다 ㅎㅎ
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
@UsePipes( new ValidationPipe({ transform: true, transformOptions: { enableImplicitConversion: true, }, whitelist: true, forbidNonWhitelisted: true, }), ) @UseFilters(SocketCatchHttpExceptionFilter) @WebSocketGateway({ // ws://localhost:3000/chats namespace: 'chats', }) export class ChatsGateway implements OnGatewayConnection { constructor( private readonly chatsService: ChatsService, private readonly messagesService: ChatsMessagesService, ) {} ... } 각각의 메소드마다 넣어주는것보다 나은것 같아서 공유 해보아요!
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
https://docs.nestjs.com/faq/request-lifecycle 공식 문서에 보니까 controller level에서 사용 할 수 있는것 같아서 controller와 gateway가 비슷하니까 사용 가능하지 않을까 해서 테스트 해보니까 @UsePipes( new ValidationPipe({ transform: true, transformOptions: { enableImplicitConversion: true, }, whitelist: true, forbidNonWhitelisted: true, }), ) @WebSocketGateway({ // ws://localhost:3000/chats namespace: 'chats', }) export class ChatsGateway implements OnGatewayConnection { ... } 해당 gateway에서 usePipes를 설정 할 수 있더라고요! 차선책으로 이것도 괜찮은것 같아서 공유 해봅니다!
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
아마 강사님 실수인듯합니다. User 1이 enter_room에 2번 채팅방에 참여 한다고 메세지를 보내는데 "enter_chat"이 맞습니다! 제가 실험 해보니까 결국 enter_chat을 제대로 하지 않은 경우에 다른 사용자가 보낸 message를 제대로 리시브 받지 못하더라고요.
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
안녕하세요 쿼리러너 관련 질문드립니다 코멘트 생성시 Pid 에 일부러 엉뚱한 값을 넣는 경우 QueryRunner를 쓰고 안쓰고에 차이가 있더라구요. 예를들어 this.commentService.ceateComment(dto, pId, user, qr); qr repository 를 일부러 사용하지 않게 조작하면 pid 에 이상한 값을 넣어도 valitation 없이 create 가 되었는데 Qr 을 넘겨주는 순간 아래와 같이 유효하지 않은 pk 에 대해 조작하려고 한다는 validation 을 해주더라구요. { "path": "/posts/{엉뚱한 값}/comments", "statusCode": 500, "message": "insert or update on table \"comment\" violates foreign key constraint \"FK_94a85bb16d24033a2afdd5df060\"", "timestamp": "1/21/2024, 4:06:08 PM" } 이런 차이는 어디서 나는것일지, 이런것들도 Query Runner 의 역할인지도 궁금합니다.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
안녕하세요, 09-데이터 정규화 1에서 구글 시트를 사용하시는데 이 주소 어디서 접속 가능할까요?
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
가입하기 버튼 누르면 에레메세지 출력하게 할때 저는 wrapper바깥으로 내용이 빠져 나가는데 어떻게 해야 wrapper크기도 같이 늘어나게 하는건가요?
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
04-05 ODM - mongoDB접속 강의에서 docker-compose build했을 때 > [mybackend 5/6] RUN yarn install: 0.132 yarn install v1.22.19 0.150 [1/4] Resolving packages... 0.176 [2/4] Fetching packages... 3.678 error mongoose@8.1.0: The engine "node" is incompatible with this module. Expected version ">=16.20.1". Got "14.21.3" 3.678 error Found incompatible module. 3.678 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ------ failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1 위와 같이 오류가 떠요. node버전이 mongoose버전과 맞지 않다고 하는데 기존 node를 삭제하고 오류에서 말한 16.20.1버전으로 새로 설치해야하는 건가요? 재 설치하면 기존에 학습했던 코드들에 영향을 받진 않나요?
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
length에서 max값을 전달 안해주고 min만 설정하고 싶을때 if(args.constraints.length===2){ } else}{ } 여기서 else 가 실행되어야 하는데 max 값 없이 validationOptions만을 전달하면 validationOptions가 두번째 인자로 전달되는 것 아닌가요..? 이렇게 하면 에러 나는데.. max 값에 undefined나 null을 넣어도 안되는 것 같습니다. 어떻게 max 값 없이 validationOptions를 실행할 수 있나요..?
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
안녕하세요. 강의내용과는 상관없는 뜬금 질문인데, 모델의 엔티티파일, api path 명 등등에 단어들을 대부분 복수로 표기하시는 이유가 따로 있는지 궁금합니다. MessageModels vs MessagesModel ? /users/:id vs user/:id ?
미해결
[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
안녕하세요. 강의 보면서 docker-compose 파일 만들고 실행하다가 막히는 부분이 있어 질문드립니다. os ubuntu 20.04 docker version Docker version 24.0.2, build cb74dfc docker-compose file services: postgres: image: postgres:15 restart: always volumes: - ./postgres-data:/var/lib/postgresql/data ports: - '5432:5432' environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres terminal log [+] Running 1/0 ✔ Container nestjs_sns_server-postgres-1 Created 0.0s Attaching to nestjs_sns_server-postgres-1 nestjs_sns_server-postgres-1 | The files belonging to this database system will be owned by user "postgres". nestjs_sns_server-postgres-1 | This user must also own the server process. nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | The database cluster will be initialized with locale "en_US.utf8". nestjs_sns_server-postgres-1 | The default database encoding has accordingly been set to "UTF8". nestjs_sns_server-postgres-1 | The default text search configuration will be set to "english". nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | Data page checksums are disabled. nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok nestjs_sns_server-postgres-1 | creating subdirectories ... ok nestjs_sns_server-postgres-1 | selecting dynamic shared memory implementation ... posix nestjs_sns_server-postgres-1 | selecting default max_connections ... 100 nestjs_sns_server-postgres-1 | selecting default shared_buffers ... 128MB nestjs_sns_server-postgres-1 | selecting default time zone ... Etc/UTC nestjs_sns_server-postgres-1 | creating configuration files ... ok nestjs_sns_server-postgres-1 | running bootstrap script ... ok nestjs_sns_server-postgres-1 | performing post-bootstrap initialization ... ok nestjs_sns_server-postgres-1 | syncing data to disk ... ok nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | Success. You can now start the database server using: nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | pg_ctl -D /var/lib/postgresql/data -l logfile start nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | initdb: warning: enabling "trust" authentication for local connections nestjs_sns_server-postgres-1 | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. nestjs_sns_server-postgres-1 | waiting for server to start....2024-01-17 13:05:30.755 UTC [49] LOG: starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.760 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.777 UTC [52] LOG: database system was shut down at 2024-01-17 13:05:30 UTC nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.786 UTC [49] LOG: database system is ready to accept connections nestjs_sns_server-postgres-1 | done nestjs_sns_server-postgres-1 | server started ... nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: listening on IPv6 address "::", port 5432 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.450 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.463 UTC [29] LOG: database system was shut down at 2024-01-17 13:30:21 UTC nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.473 UTC [1] LOG: database system is ready to accept connections nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.019 UTC [1] LOG: received fast shutdown request nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.024 UTC [1] LOG: aborting any active transactions nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.025 UTC [1] LOG: background worker "logical replication launcher" (PID 32) exited with exit code 1 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.025 UTC [27] LOG: shutting down nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.030 UTC [27] LOG: checkpoint starting: shutdown immediate nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.063 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.011 s, sync=0.005 s, total=0.038 s; sync files=2, longest=0.003 s, average=0.003 s; distance=0 kB, estimate=0 kB nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.069 UTC [1] LOG: database system is shut down (1만자 이하로 작성해야 해서 로그는 중간 생략하였습니다.) docker-comopse 파일이 정상적으로 실행이 되고 있는 상황인데 Postgresql 데이터 베이스 연결하면서 문제가 발생하고 있는것 같습니다. 프로젝트 폴더의 postgres-data 폴더에도 postgresql 데이터가 생성되지 않았구요. 혹시 제가 잘못하고 있는 부분이 있을까요..?
해결됨
[개정판] 파이썬 머신러닝 완벽 가이드
교수님 안녕하십니까 교수님의 수업을 정말 즐기면서 듣고있는 AI빅데이터 전공 대학생입니다. 교수님의 강의 피마 인디언 당뇨병 예측 편을 보고 여태 배운 것을 백분 활용하여 제 방식대로 따로 모델을 구현을 해보았는데요. 먼저 임신횟수와 Outcome을 제외한 나머지 column들에 있는 0 값들은 모두 결측치로 판단하고 평균 값으로 대체하였습니다. RandomForestClassifier 알고리즘을 사용하고 GridSearchCV 함수를 통해 best estimator를 추출였습니다. 정밀도와 재현율이 동시에 높으면 좋지만 재현율이 증가하면 정밀도가 하락하는 현상(trade-off) 때문에 둘 중 하나를 선택해야 했고 이 피마 인디언 당뇨병 데이터 셋 같은 경우 병의 발견 목적으로 모델을 제작한다고 했을 때 실제로 당뇨병인데 모델이 당뇨병이 아니라고 예측하는 것이 치명적이라고 생각하여 정밀도 보다는 재현율을 중점적으로 보았습니다. 그리하여 precision_recall_curve 함수를 통해 최적의 재현율과 F1_score얻은 threshold 값을 추출하였습니다. 제가 얻은 값은 오차 행렬 [[72 28] [ 4 50]] 정확도: 79.22% , 정밀도: 64.10% , 재현율 92.59%, F1_Score: 75.76% 임계값: 0.32212471005503873 입니다. 오차 행렬을 보았을때도 한쪽에 치우쳐있는 불균형도 없다고 판단하였고 정밀도와 재현율 f1_score도 괜찮게 나왔다고 판단했습니다. 임계값을 0.32212471005503873로 주었을 때 roc_auc_score는 0.82296이라는 1에 꽤나 근접한 수치를 얻었습니다. 질문1: 이런식으로 모델을 찾아가는 방식이 옳은 방식인지 궁금합니다. 질문2: 제가 선택한 모델을 사용한다고 한다면 매번 RandomClassifier로 fit한 model을 Binarizer을 통해서 threshold 값을 매번 지정해주어야 하는건가요? 애초에 처음 모델을 fit할 때 임계값을 제가 부여는 못하는 것일가요?
해결됨
작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지
2024/01/15 15:08:24 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.64.1, server: , request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8000/", host: "192.168.64.7" 위와 같은 오류가 발생하는데 문제가 무엇인지 모르겠습니다.
해결됨
작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지
File "/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py", line 193, in init super().__init__(*args, **kwargs2) django.db.utils.OperationalError: (1044, "Access denied for user 'django'@'%' to database 'django'") mariadb 컨테이너를 실행 후, django 컨테이너를 실행 시 위와 같은 오류가 발생합니다. 찾아보니 django 에 대한 권한이 없어서 그렇다고 하는데, 해결방법이 있을까요?