Django高级应用
作者:互联网
一,静态文件
-
css,js,图片,json文件,字体文件等
1.1 新建以下目录:\Django\MyDjango\project\static\MyApp\css \Django\MyDjango\project\static\MyApp\font \Django\MyDjango\project\static\MyApp\image \Django\MyDjango\project\static\MyApp\js \Django\MyDjango\project\static\MyApp\json \Django\MyDjango\project\static\MyApp\other
1.2 settings.py 文件中设置静态文件路径
STATICFILES_DIRS = [ os.path.join(BASE_DIR,"static") ]
1.3 添加css文件 \Django\MyDjango\project\static\MyApp\
标签:文件,应用,高级,Django,project,static,MyApp,MyDjango 来源: https://blog.csdn.net/zhuan_long/article/details/114867574