3.1配置文件(settings.py)
3.2静态文件使用
3.2.1配置静态文件的访问
# 静态⽂件访问的路由
STATIC_URL = '/static/'
# 配置静态⽂件加载⽬录
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static_files')
]
3.2.2准备静态文件1
项目根路径/静态文件夹/静态文件
项目根路径/static_files/index.html
http://127.0.0.1:8000/static/index.html
3.2.3准备静态文件2
项目根路径/static_files/goods/detail.html
http://127.0.0.1:8000/static/goods/index.html
3.3路由的使用
3.3.1django解析路由的流程