230511 개발일지 TIL - 맥 환경 터미널에서 python파일을 실행하다보면 생기는 오류

The Web On Everything·2023년 5월 11일
0

개발일지

목록 보기
13/269

맥 환경 터미널에서 python파일을 실행하다보면 오류가 생기는데
이럴 땐 5000포트가 이미 사용 중이니 포트번호를 5001이나 다른 포트로 변경해주면 해결이 된다.

Address already in use
Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.
On macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> Sharing.

flask(웹 프레임워크) jinja2.exceptions.TemplateNotFound 오류
같은 폴더 안에 파일이 있으면 안되고 templates(template 오타주의)폴더를 만들고 그 안에 사용할 html페이지를 넣어줘야 함

  • templates -> index.html

link에 보면 href로 css파일을 지정하는 부분이 있는데
url_for를 이용해서 filename을 입력하면 주소가 자동으로 바인딩 됨

<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
profile
오늘은 무슨 오류를 만날까?! 널 만나러 가는 길~ LOL

0개의 댓글