静态文件
静态文件配置 - settings.py中
1,配置静态文件的访问路径【该配置默认存在】
通过哪个url地址找静态文件
STATIC URL=‘/static/’
说明
指定访问静态文件时是需要通过/static/xxx或http://127.0.0.1:8000/static/xxx
[xxx表示具体的静态资源位置]
模板中访问静态文件- img标签为例
通过{% static %}标签访问静态文件
1.加载 static -%load static % static静态资源路径
2.使用静态资源-{% static ‘静态资源路径’%}
3.样例
<img src="{% static 'images/lenajpg' %}">