mysite2/setting.py
STATIC_URL = '/static/'
STATICDILES_DIRS =[
os.path.join(BASE_DIR, 'static'),
]
在根目錄下新建static

image.png
在book/index.html顯示圖片
#固定的寫法
<img src="/static/book/images/pubu.jpg" alt="瀑布">
{% load static from staticfiles %}
<img src="{% static "book/images/pubu.jpg" %}" alt="瀑布">