[問題] 新手請問關於css,js,圖片靜態文件
大家好
剛學習django不久,現在遇到了一個問題
以下是app的配置圖
- mysite
-static (css,image,js都放在這裡)
-templates (hello_wprld.html)
-trips
#setting.py#
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
('css','\mysite\static\css'),
('font','\mysite\static\font'),
('js','\mysite\static\js'),
('sass','\mysite\static\sass'),
('image','\mysite\static\image'),
執行http://127.0.0.1:8000/hello_world.html
css,js,圖片都沒有載入,只有我html裡寫的table Q__Q
如果直接連過去看,有些js或css的程式碼可以顯示出來
ex: http://127.0.0.1:8000/static/js/init.js
下面截取圖片code,請大家幫我看看
<img src="{% static '/static/image/1.jpg' %}" alt="My image"/>
不好意思問題很雜很亂,實在是沒有頭續,還請大家幫忙
非常感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.227.157.49
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1472629230.A.7F5.html
→
08/31 16:54, , 1F
08/31 16:54, 1F
不好意思,不小心打錯了,我是用 / 已修改 多謝提醒
※ 編輯: fealing (125.227.157.49), 08/31/2016 17:07:58
推
08/31 17:27, , 2F
08/31 17:27, 2F
→
08/31 18:00, , 3F
08/31 18:00, 3F
→
08/31 18:14, , 4F
08/31 18:14, 4F
→
08/31 18:52, , 5F
08/31 18:52, 5F
→
08/31 18:52, , 6F
08/31 18:52, 6F
→
08/31 18:52, , 7F
08/31 18:52, 7F