분류 전체보기 67

python-yeelight response error, Bulb closed the connection. 발생시

File "/home-light-_QDhjiKn-py3.8/lib/python3.8/site-packages/yeelight/main.py", line 344, in _command cmd = self.send_command( File "/home/jun/.cache/pypoetry/virtualenvs/home-light-_QDhjiKn-py3.8/lib/python3.8/site-packages/yeelight/main.py", line 814, in send_command raise BulbException(response["error"]) yeelight.main.BulbException: Bulb closed the connection. 위와 같은 에러가 발생해서, 어쩔 수 없는 문제인가보다....

Programming 2022.02.02

[Flutter] overflow 처리하기

다음과 같은 flutter 코드가 있다. Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(bottom: 4.0), child: Row( children: [ Text( category, style: TextStyle(fontSize: 12), ) ], ), ), Row( children: [ Text( title, style: TextStyle(fontSize: 24), ), ], ) ], ); 카테고리와 제목을 표현하는 리스트 항목 컴포넌트이다. 하지만 이를 구현하면 음.. css였으면 overflow를 통해서 해결할 수 있었을 텐데, 한 번 넣어보자. 다음 st..

Programming/Flutter 2022.01.28

[Django, AWS S3] S3를 사용해서 django static파일 관리하기

배경 이야기 지금 운영중인 서비스에는 대용량 파일(10MB~2GB)을 업로드/다운로드 해야하는 작업이 있다. 이 작업을 기존에는 django의 static으로 자체 관리하였는데 두 가지 문제가 있었다. 1. 백엔드(api) 서버의 저장공간의 부족을 일으킬 수 있다. 2. 대용량 업로드/다운로드는 네트워크 비용을 증가시킨다. 이 2가지 문제는 Cloud Server가 제공해주는 Storage 서비스를 통해 쉽게 해결 될 수 있다. 따라서 우리는 Azure의 'Azure Storage' 서비스를 사용하고 있었는데, 이번에 aws로 서버를 옮기면서 Storage 서비스도 'Amazon S3'로 변경하기로 했다. 본 게시글은 이 이전작업에 기초하여 작성됨을 알고 읽기를 바란다. 참고한 글 aws s3 미디어 서..

Programming/Django 2022.01.21

[VSCode] Windows에서 remote-container vscode 붙이기

TL;DR https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host Develop a container on a remote Docker host Develop a container on a remote Docker host code.visualstudio.com 본 게시글은 위 과정을 따릅니다. VSCode 그리고 Docker vscode는 정말 엄청난 속도로 발전하고 있다. 대부분의 프로젝트에서 vscode로 처리할 수 있으니 말이다. 그 중에서도 docker와 관련된 'Fancy'한 기능인, vscode를 remote-container에 연결하는 방법을 한 번 알아보자. remote container? attach vsc..

Programming 2022.01.20

[Web] 검색을 위한 좋은 RESTful URL은 어떤걸까?

https://stackoverflow.com/questions/5020704/how-to-design-restful-search-filtering How to design RESTful search/filtering? I'm currently designing and implementing a RESTful API in PHP. However, I have been unsuccessful implementing my initial design. GET /users # list of users GET /user/1 # get user with id 1 POST /u... stackoverflow.com 이번에 백엔드 작업을 하면서 검색에 대한 url을 어떻게 만들지 고민이 생겼다. 카테고리 이동 겸 검색..

Programming/Web 2022.01.19

[VSCode] vscode debugger 사용시 환경변수 세팅

이번에 docker-compose setting을 변경하고 vscode debugger로 django 작업을 해보았다. 그런데 command로 gunicorn을 실행시킨 것과 vscode debugger에서 실행시킨 것의 CORS_ORIGIN_WHITELIST가 다르게 설정되어 있었다. 뭔가 이상하여 환경변수들을 몇개 찍어보았는데 내가 설정한 env파일이 아닌 다른 파일이 들어가 있었다. 좀 더 자세히 서술하자면, 1. 이건 dev container였기 때문에 .env.dev 파일을 사용하였다. 2. command로 그냥 실행한 django(gunicorn)은 환경변수가 적절히 설정된다. 3. debugger로 실행한 django는 .env 파일로 환경변수가 설정된다.(해당 폴더내에 .env.dev/ ...

Programming 2022.01.18