Reputation: 6849
I am new to python Django.
I have a project like this below:
But in my TestModel
APP, there is a index.html here:
<!doctype html>
{% load staticfiles %}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="" />
<meta name="description" content="" />
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" /> -->
<title>Python探索馆 - Slice</title>
<!-- Main Theme -->
<link rel="stylesheet" href="{% static 'css/style.css' %}" />
<!-- Font -->
<link rel="stylesheet" href="http://at.alicdn.com/t/font_n5vylbuqe61or.css" />
</head>
<body>
...
You see I have load the static files.
And in my testdj/
the settings.py
, I have set the STATIC_URL
:
STATIC_URL = '/static/'
But in the browser, the stylesheet did not load success.
EDIT-1
The css structrue:
Upvotes: 0
Views: 63
Reputation: 599796
You have put your static files in your template folder. That is not where they go. You need to put them either in your app or in a folder that is referenced by the STATICFILES_DIRS setting.
Upvotes: 3