inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

캐시 구현에서 Redis - MongoDB 스코프

미해결

배달앱은 어떻게 내 주변의 맛집을 찾을까?

제가 이해한 구조는 아래와 같습니다. Request -> API -> Service -> Entity Redis에서 캐시 조회 실패하면 redis에서 몽고 db collection 관련 함수를 직접 조회 하는 게 아니라 서비스로 돌아가서 서비스단에서 몽고 db collection 관련 함수를 호출하는게 맞지 않나요? 아니면 주신 코드 처럼 Entity 단에서는 서로를 호출하면서 작동하는게 맞나요?

  • python
  • mongodb
  • FastAPI
파사 댓글 2 좋아요 0 조회수 175

선생님 질문 있습니다.

미해결

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트 (장고 4.2 기준)

1) request.META["HTTP_USER_AGENT"] 실습 5번 내내 NameError로 표기 되지 않습니다. 구글링해도 정확히 어떤 이유인지 잘모르겠습니다. 2) 아래 pwsh 느낌표가 왜 나오는지 궁금합니다.

  • react
  • python
  • django
  • web-api
  • htmx
lkh5040 댓글 1 좋아요 0 조회수 99

travis ci가 이제 유료화가 된 것 같습니다;;;

미해결

따라하며 배우는 도커와 CI환경 [2023.11 업데이트]

이거 무료로 할 수 있는 방법이 있을까요? 인강 진행이 안되네요.

  • aws
  • docker
  • github
  • ci/cd
  • travis-ci
  • 데이터-엔지니어링
윤석배 댓글 2 좋아요 0 조회수 231

안녕하세요 선생님,

미해결

파이썬/장고로 웹채팅 서비스 만들기 (Feat. Channels) - 기본편

#consumers.py from asgiref.sync import async_to_sync from channels.generic.websocket import JsonWebsocketConsumer from chat.models import Room # 모든 유저가 고정된 채널 레이어 그룹을 가질것. class ChatConsumer(JsonWebsocketConsumer): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) SQUARE_GROUP_NAME = "square" self.group_name = [SQUARE_GROUP_NAME] self.room = None def connect(self): user = self.scope['user'] if not user.is_authenticated: self.close() else: room_name = self.scope['url_route']['kwargs']['room_pk'] try: self.room = Room.objects.get(pk=room_name) except Room.DoesNotExist: #지정 룸 pk에 룸 인스턴스가 없을 경우 웹소켓 연결요청 수락. pass else: self.group_name = self.SQUARE_GROUP_NAME is_new_join = self.room.user_join(self.channel_name, user) if is_new_join: async_to_sync(self.channel_layer.group_send)( self.group_name, { "type": "chat.user.join", "username": user.username, } ) async_to_sync(self.channel_layer.group_add)( self.group_name, self.channel_name ) self.accept() def disconnect(self, code): if self.group_name: async_to_sync(self.channel_layer.group_discard)( self.group_name, self.channel_name ) user = self.scope['user'] if self.room is not None: is_last_leave = self.room.user_leave(self.channel_name, user) if is_last_leave: async_to_sync(self.channel_layer.group_send)( self.group_name, { "type": "chat.user.leave", "username": user.username, } ) def chat_user_join(self, message_dict): self.send_json({ "type": "chat.user.join", "username": message_dict["username"], }) def chat_user_leave(self, message_dict): self.send_json({ "type": "chat.user.leave", "username": message_dict["username"], }) def chat_message(self, message_dict): self.send_json({ "type": "chat.message", "message": message_dict["message"], "sender": message_dict["sender"], }) def receive_json(self, content, **kwargs): user = self.scope["user"] _type = content["type"] if _type == "chat.message": message = content["message"] sender = user.username async_to_sync(self.channel_layer.group_send)( self.SQUARE_GROUP_NAME, { "type": "chat.message", "message": message, "sender": sender, } ) else: print(f"Invalid message type : ${_type}") room_name = self.scope['url_route']['kwargs']['room_pk'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'room_pk' 이런 에러가 나서, urls.py, views.py, index.html도 맞춰줘 봤지만, 잘 해결이 되질 않습니다. 어떤식으로 이 에러를 처리해야할까요. 오늘도 좋은 하루 되시길 바랍니다. 감사합니다.

  • python
  • django
  • django-channels
sunnnwo 댓글 1 좋아요 0 조회수 118

상세페이지로 이동하는 url을 받아서 이동할때, url유형이 달라요

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

상세페이지 href속성을 찾아 기존페이지 url?상세페이지 url을 적용하여 실습을 성공해 오다가 난관에 부딪혔습니다. html속성값을 보니 아래와 같이 되어 있고 url에 붙이거나 해도 페이지가 로드 되지 않아 어려움을 겪고 있습니다. <a href="Javascript:view_content('869');">처리 일정 문의 드립니다.</a> 위와같은 href가 나타날때는 어떻게 상세페이지로 이동해야 하는지 궁금하고 이럴때 혹시 우회할 수 있는 대안이 있다면 알고 싶어요

  • python
  • 웹-크롤링
민소리 댓글 1 좋아요 0 조회수 126

SbbApplicationTests 런오류 tetJpa부분?

미해결

백엔드 개발을 위한 필수 강의 - 스프링 부트3

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-02-13T00:15:43.156+09:00 ERROR 7780 --- [ main] o.s.boot.SpringApplication : Application run failed Error creating bean with name 'entityManagerFactory' 이런 오류가 뜹니다 쿼리가 안 만들어져요 이오류 때문에 ㅜ

  • java
  • aws
  • spring-boot
손진주 댓글 1 좋아요 0 조회수 99

SbbApplicationTests에서 JUnit Test런을 하면 x표시하며 오류가나요!!!

미해결

백엔드 개발을 위한 필수 강의 - 스프링 부트3

package com.mysite.sbb; import static org.junit.jupiter.api.Assertions. assertEquals ; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SbbApplicationTests { @Autowired private QuestionRepository questionRepository ; @Test void testJpa() { Question q = this . questionRepository .findBySubjectAndContent( "sbb가 무엇인가요?" , "sbb에 대해서 알고 싶습니다." ); assertEquals (1, q .getId()); } }

  • java
  • aws
  • spring-boot
손진주 댓글 1 좋아요 0 조회수 135

쿼리문이 console에서 형성이 안되고 아래와 같은 코드오류걸려요

미해결

백엔드 개발을 위한 필수 강의 - 스프링 부트3

package com.mysite.sbb; import static org.junit.jupiter.api.Assertions. assertEquals ; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SbbApplicationTests { @Autowired private QuestionRepository questionRepository ; @Test void testJpa() { Question q = this . questionRepository .findBySubjectAndContent( "sbb가 무엇인가요?" , "sbb에 대해서 알고 싶습니다." ); assertEquals (1, q .getId()); } }

  • java
  • aws
  • spring-boot
손진주 댓글 1 좋아요 0 조회수 127

SbbApplicaitonTest JUnit 테스트 런을 하면 아래와 같은 오류가 Console에 뜹니다

미해결

백엔드 개발을 위한 필수 강의 - 스프링 부트3

19:49:22.386 [main] INFO org.springframework.test.context.support .AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.mysite.sbb.SbbApplicationTests]: SbbApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration. console에 위와 같은 문구가 나오고 아래로 실행 문구가 뜨지 않습니다.

  • java
  • aws
  • spring-boot
댓글 1 좋아요 0 조회수 135

[리포지터리] SbbApplicationTests에서부터 오류

미해결

백엔드 개발을 위한 필수 강의 - 스프링 부트3

package com.mysite.sbb; import java.time.LocalDateTime; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SbbApplicationTests { @Autowired private QuestionRepository questionRepository; @Test void testJpa() { Question q1 = new Question(); q1.setSubject("sbb가 무엇인가요?"); q1.setContent("sbb에 대해서 알고 싶습니다."); q1.setCreateDate( LocalDateTime.now ()); this.questionRepository.save (q1); // 첫번째 질문 저장 Question q2 = new Question(); q2.setSubject("스프링부트 모델 질문입니다."); q2.setContent("id는 자동으로 생성되나요?"); q2.setCreateDate( LocalDateTime.now ()); this.questionRepository.save (q2); // 두번째 질문 저장 } } 런타임을 시작하면 위에 첨부된 파일에 빨간색 x표시로 오류가 뜹니다. Bootdashboard에 중지버튼이 비활성화되어있어요

  • java
  • aws
  • spring-boot
손진주 댓글 1 좋아요 0 조회수 120

react19에서는 react-beautiful-dnd가 설치되지 않습니다.

미해결

따라하며 배우는 리액트 A-Z[19버전 반영]

https://github.com/atlassian/react-beautiful-dnd/issues/2672 react-beautiful-dnd is now deprecated #2672 Drag and Drop 기능 구현을 위한 다른 방법 설명이 필요합니다.

  • react
  • redux
  • tdd
  • typescript
  • next.js
  • 소프트웨어-테스트
서상연 댓글 1 좋아요 0 조회수 854

pgAdmin 질문

미해결

Next + React Query로 SNS 서비스 만들기

pgAdmin의 Post 데이터를 전부 삭제한 후 다시 기록하고 싶어서 Post 내부 데이터를 전부 선택/삭제(휴지통 버튼 클릭)한 후 PSQL Tools에 COMMIT을 입력하라고 정보가 있어서 실행에 옮겼는데 갑자기 9090페이지가 아예 안돌아가네요(로그인 안됨, API문서 접근불가 등등) ㅠㅠ 어떻게 방법없을까요

  • react
  • next.js
  • react-query
  • next-auth
  • msw
심현석 댓글 1 좋아요 0 조회수 157

%0이 짝수라는뜻인가요?

미해결

문과생도, 비전공자도, 누구나 배울 수 있는 파이썬(Python)!

50%2를 하면 25인데 25일경우에는 0이 아닌데 이해가 잘 안되어서요 그냥 %2=0이면 짝수라는 통용되는 개념인가요?

  • python
escho94 댓글 1 좋아요 0 조회수 156

continue에 관해서 질문드립니다

미해결

문과생도, 비전공자도, 누구나 배울 수 있는 파이썬(Python)!

for i in range(10): print(i) if i < 5: continue elif i == 7: break 여기서 출력값이 01234567이 나왔는데 567이 나오는건 이해하겠는데 0부터 4는 if구문의 continue 때문에 건너뛰어야하는것 아닌가요..? 왜 이렇게 출력이 되는지 궁금해요

  • python
댓글 1 좋아요 0 조회수 126

확인부탁합니다_부록1의 순서

미해결

칼만 필터: 예제로 이해하는 상태추정의 수학적 원리

아래 순서가 부록 : 1 사전확률 &사후확률 부록 : 1 MLE & MAP 부록 : 1 베이즈 정리(Bayes Theorem) 이처럼 되는거가 맞지 않나요? 페이지번호가 그런거 같은데요 부록 : 1 베이즈 정리(Bayes Theorem) 부록 : 1 MLE & MAP 부록 : 1 사전확률 &사후확률

  • python
  • MATLAB
  • 선형대수학
  • kalman-filter
  • 확률과-통계
문병훈 댓글 1 좋아요 1 조회수 164

샘플 템플릿이 안보이네요

미해결

AWS Certified Solutions Architect - Associate 자격증 준비하기

안녕하세요 CloudFormation 해당 부분의 AWS 메뉴가 변경된건지 샘플 템플릿의 메뉴 항목이 보이지 않네요 시간이 되시면 이부분 어떻게 접근해야 하는지 답변 주시면 감사하겠습니다.

  • 네트워크
  • aws
국진 댓글 1 좋아요 0 조회수 113

하나의 채팅방만 만들어보려고 하는데 잘 안되고 있습니다.

미해결

파이썬/장고로 웹채팅 서비스 만들기 (Feat. Channels) - 기본편

안녕하세요 선생님. 인증받지 않은 유저의 웹소켓 접근을 거부하려고 하는데요, Traceback (most recent call last): File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/django/contrib/staticfiles/handlers.py", line 101, in __call__ return await self.application(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/channels/routing.py", line 62, in __call__ return await application(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/channels/sessions.py", line 47, in __call__ return await self.inner(dict(scope, cookies=cookies), receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/channels/sessions.py", line 263, in __call__ return await self.inner(wrapper.scope, receive, wrapper.send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/channels/auth.py", line 185, in __call__ return await super().__call__(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sunnnwo/workspace/pongchatT/venv/lib/python3.11/site-packages/channels/middleware.py", line 24, in __call__ return await self.inner(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'list' object is not callable WebSocket DISCONNECT /ws/chat/test/chat/ [127.0.0.1:61013] HTTP GET /chat/ 200 [0.01, 127.0.0.1:61007] /Users/sunnnwo/workspace/pongchat/mysite/asgi.py changed, reloading. Watching for file changes with StatReloader 아래와 같이 설정하고 실행해봤는데, 위와 같은 에러가 발생했습니다. AuthMiddlewareStack을 이용하여 인증된 사용자만 채팅할 수 있게 하려면 어느 부분을 수정해야할까요. 감사합니다. 좋은 하루되세요. asgi.py application = ProtocolTypeRouter({ "http" : django_asgi_app, "websocket" : AuthMiddlewareStack( app.routing.websocket_urlpatterns + chat.routing.websocket_urlpatterns, ), }) consumers.py from asgiref.sync import async_to_sync from channels.generic.websocket import JsonWebsocketConsumer # 모든 유저가 고정된 채널 레이어 그룹을 가질것. class ChatConsumer(JsonWebsocketConsumer): SQUARE_GROUP_NAME = "square" groups = [SQUARE_GROUP_NAME] def receive_json(self, content, **kwargs): # user = self.scope["user"] user = self.scope["user"] _type = content["type"] if not user.is_authenticated: self.close() else: if _type == "chat.message": message = content["message"] async_to_sync(self.channel_layer.group_send)( self.SQUARE_GROUP_NAME, { "type": "chat.message", "message": message, } ) else: print(f"Invalid message type : ${_type}") def chat_message(self, message_dict): self.send_json({ "type": "chat.message", "message": message_dict["message"], }) chat/routing.py from django.urls import path, re_path from chat import consumers websocket_urlpatterns = [ path("ws/chat/<str:room_name>/chat/", consumers.ChatConsumer.as_asgi()), ] chat/urls.py urlpatterns=[ path("", views.index, name = "index"), path("<str:room_name>/chat/", views.room_chat, name = "room_chat" ), ]

  • python
  • django
  • django-channels
sunnnwo 댓글 1 좋아요 0 조회수 140

한글 수식을 자동으로 넣는 코드를 만들었는데, 수식 사이의 간격이 계속 벌어집니다.

미해결

직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피

선생님 강의랑 블로그 참고해서, 문서 내 특정 문자들을 찾아서 수식으로 바꾸는 작업을 진행했습니다. A라는 문자가 문서 내에 있으면, 찾기 기능으로 찾은 뒤에 수식 편집기를 열어서 rm A로 바꿔주는 작업을 합니다. 그런데 문자를 전부 수식으로 바꾸고 나니 글자들의 간격이 다 벌어져있네요... 수식을 누르고 방향키로 빠져나오거나, 개체 속성에 들어갔다 나오면 다시 돌아오는 상황입니다. 왜 이런 일이 발생하는지 잘 모르겠고, 어떻게 해결할 수 있을까요? https://employeecoding.tistory.com/194 수식 넣을 때 코드는 이 게시글에 있는 코드를 사용했습니다.

  • python
  • 한컴오피스
손주환 댓글 1 좋아요 1 조회수 807

여행 숙박 사이트 부분 질문있습니다.

해결됨

[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스

안녕하세요 강의를 듣다가 여행 숙박 사이트 부분의 강의를 보고 싶은데 이 부분은 어디서부터 보면 되나요?

  • react
  • react-native
  • 하이브리드-앱
  • graphql
  • next.js
부드러운 족제비 댓글 2 좋아요 0 조회수 113

인기 태그

인프런 TOP Writers

주간 인기글