取的風格,當我試圖加載從靜態的我的樣式表就不能獲取和執行的CSS到我的項目靜態CSS是不是在Django
我的文件夾進去的家onething \家\靜\家 我遇到的style.css u can check folder structure in image
這裏是我base.html文件
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>{% block title %}One Thing{% endblock %}</title>
{% load staticfiles %}
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.pink-purple.min.css"/>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Lobster">
<link rel="stylesheet" type="text/css" href="{% static 'home/style.css' %}"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
</head>
</html>
和我設置爲去
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'home.apps.HomeConfig',
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
但我的CSS樣式表未加載。請幫我在哪裏,我沒有搞錯
它的工作結束後,剛剛清除瀏覽器通過CRLT + SHIFT + R –