mysite2/setting.py
STATIC_URL = '/static/'
STATICDILES_DIRS =[
os.path.join(BASE_DIR, 'static'),
]
在根目录下新建static
在book/index.html显示图片
#固定的写法
<img src="/static/book/images/pubu.jpg" alt="瀑布">
{% load static from staticfiles %}
<img src="{% static "book/images/pubu.jpg" %}" alt="瀑布">