tango with django ch5 template&static file
来源:互联网 发布:淘宝店铺账小号 编辑:程序博客网 时间:2024/06/01 10:09
配置模版
- 在tango_with_django_project下新建templates文件夹
- 配置tango_with_django_project/setttings.py
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')TEMPLATE_DIRS = ( TEMPLATE_PATH, )
- 新建templates/rango
- 新建templates/rango/index.html
- render模版
配置静态文件夹– getting a static media file onto one of your pages
- 在static文件夹下
mkdir images
- 设置setttings.py
STATIC_PATH = os.path.join(BASE_DIR, 'static')STATIC_URL = '/static/'STATICFILES_DIRS = ( STATIC_PATH,)
- 在模版中引用静态文件
{% load staticfiles %} <img src="{% static "images/rango.jpg" %}" alt="Picture of Rango"/>
0 0
- tango with django ch5 template&static file
- tango with django ch12
- 基于How To Tango With Django 1.9的重新实践(13)——Template Tags
- tango with django ch6 Model
- tango with django ch7 MTV
- 学习Tango with django(1)
- 学习Tango with django(2)
- 学习Tango with django(3)
- tango with django chapter 4 Django Basics
- 基于How To Tango With Django 1.7的实践(4)——Templates and Static Media
- Django(1)Tango with Django过程中的问题
- django网站设计与规划【Tango with Django】
- Django static media template目录设置方法
- Django中static、media与template设置
- django 1.3使用static file
- 基于How To Tango With Django 1.7的实践(3)——Django Basics
- 基于How To Tango With Django 1.7的实践(1)
- 基于How To Tango With Django 1.7的实践(2)
- velocity map list 数组操作
- 机器学习笔记(一)
- netty实战进阶
- STL中二分查找 lower_bound()
- 操作系统的文件系统基本调用命令
- tango with django ch5 template&static file
- Illegal resource reference: @*android resources are private and not always present 解决方案
- 导航框架
- 如何建立一个快速显示桌面的快捷方式?
- 设计模式之装饰(Decorator)模式
- Dubbo高级篇_07_Dubbo服务接口的设计原则
- EhCache简介
- as-build.gradle
- Spring MultipartResolver 和ServletFileUpload 冲突导致获取不到上传文件的url