저렇게 불러오면 안 된다는 것조차도 몰랐어요.

Django 강의 중에 static(스타틱) 강의가 있어서 다시 보았어요. 🤣

 

해결 과정

settings.py

# 정적 파일 경로 설정
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'core/static'),
]
경로를 os로 설정해주었어요.

 

templates/base.html

{% load static %}
<link rel="stylesheet" href="{% static "articles_css/style.css" %}">
static은 이렇게 쓰는 거였어요!

{% load static %}를 쓰고, <link>로 static 파일을 불러오면 돼요.

 

style.css가 적용된 서버 화면

🐾Recent posts