기본 콘텐츠로 건너뛰기

Flask 10. static 파일 관리하기

Flask 10. static 파일 관리하기

플라스크에서는 static 파일을 관리하는 것이 굉장히 단순하다. 그냥 프로젝트 안에 static 폴더를 만들면된다. 그러면 이 폴더가 기본적으로 static url 주소의 하위로 지정이 되므로 파일을 해당 폴더에 둬서 갖다쓰면 된다.

label { font-size : 20px; font-weight : 700; }

그리고 이것을 register.html 코드에 적용한다.

... ...

이런식으로 추가하면 된다.

이제 적용이 됐는지 확인해보자.

확실히 페이지가 변경된 것을 알 수 있다.

style.css파일이 적용이 되었다.

또한 플라스크의 url_for()함수에 의해서 해당 파일의 url도 알아서 적용되었다.

플라스크에서 static 파일을 관리하는 것은 매우 간단하다.

from http://ohdowon064.tistory.com/117 by ccl(A) rewrite - 2020-03-11 02:54:14

댓글

이 블로그의 인기 게시물

Flask 13. pythonanywhere에 배포하기

Flask 13. pythonanywhere에 배포하기 Login: PythonAnywhere It's always a pleasure to hear from you! Ask us a question, or tell us what you love or hate about PythonAnywhere. We'll get back to you over email ASAP. Sorry, there was an error connecting to the server. Please try again in a few moments... www.pythonanywhere.com from http://ohdowon064.tistory.com/124 by ccl(A) rewrite - 2020-03-11 15:54:10

외래어 정리

외래어 정리 [A] acacia 아카시아 academic 아카데믹 academy 아카데미 acanthus 아칸서스 accelerator 액셀러레이터 accent 악센트 acceptor 억셉터 access 액세스 accessory 액세서리 accordion 아코디언 ace 에이스 acetate 아세테이트 acetaldehyde 아세트알데히드 acetic acid 아세트(산) acetone 아세톤 acetyl 아세틸 acetylene 아세틸렌 Achilles tendon 아킬레스(건) acre 에이커 acrylic acid 아크릴(산) action 액션 active 액티브 acyl 아실 AD 에이디 adagio 아다지오 adapter 어댑터 ad + balloon 애드벌룬 address 어드레스 adenine 아데닌 adrenaline 아드레날린 advantage 어드밴티지 aerobic dance 에어로빅 댄스 aerofoil 에어로포일 aerosol 에어로졸 afghan 아프간 [편물] after + service 애프터서비스 agape 아가페 Ainu 아이누 air conditioner 에어컨(디셔너) airspray 에어스프레이 album 앨범 albumin 알부민 alcohol 알코올 aldehyde 알데히드 ALGOL 알골 algorism 알고리즘 alibi 알리바이 alkali 알칼리 alkaloid 알칼로이드 Allah 알라 allegory 알레고리 allegretto 알레그레토 allegro 알레그로 alleluia 알렐루야 Allergie 알레르기 alligator 앨리게이터 all-in-one 올인원 almond 아몬드 aloha 'oe 알로하 오에 Alpenhorn 알펜호른 alpha 알파 alphabet 알파벳 ...