티스토리 뷰
Issue:
배포 연습 중 debug=False 로 셋업했더니 로컬호스트 주소에서 미디어 파일이 로딩되지 않음.
e.g. "GET /static/css/bootstrap.min.css HTTP/1.1" 404 179
Solution:
debug 모드를 켜면(==True) 에러의 디테일한 사항을 설명해준다. False의 상황에서는 ALLOWED_HOSTS 가 세팅되어야 있어야 하고, 미디어, 스태틱 파일의 엑세스가 제한된다. 즉 웹서버를 통해서 제공해야 함.
- TheDEBUG=True, if there is error, page will show details of error.
- ifDEBUG=False, theALLOWED_HOSTSofsettings.pywill work, you should take carefully to set it.
- themediaandstaticwill not provide access forDEBUG=False, you have to provide them with the help of webserver, likeNginxorApache
출처: stackoverflow
'Django' 카테고리의 다른 글
django url routing (0) | 2021.07.14 |
---|---|
Tutorial Base Feedback and Learning: 버그와 개발자의 의도 사이 (0) | 2021.07.12 |
장고 리다이렉트 #앵커태그(anchor tag )로 페이지의 특정 위치로 이동하기 (0) | 2021.07.12 |
TBC - AWS 장고 배포 (0) | 2021.07.10 |
Django (0) | 2021.06.07 |
댓글