django 引用static templates
来源:互联网 发布:ubuntu关闭apache服务 编辑:程序博客网 时间:2024/05/17 23:47
引用static
1. 在django project中创建 static文件夹
2.settings.py中配置要在 STATIC_URL = '/static/' 下边
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'), ]
3前端引用
{% load staticfiles %}
在 link script 等src 写 :
{%static 'xxx.css'%}
{%static 'xxx.js'%}
应用templates
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.static',
],
},
},
]
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
# 下面的会影响到admin的样式
STATIC_ROOT = 'static'STATIC_URL = '/static/'
- django 引用static templates
- Django&templates
- pycharm django templates css js html static文件详解
- Django Templates的设置
- django学习--templates模板
- Django之templates
- django入门 Templates介绍
- Django框架-Templates进阶用法
- django templates setting 地址设置
- django 1.8 app add templates
- django(views、urls、templates)
- Django学习(六)(模板templates)
- 初识Django-模版文件templates
- 基于How To Tango With Django 1.7的实践(4)——Templates and Static Media
- Django框架学习-Templates进阶用法
- Python Web开发Django、Flask之Templates
- 二 Django 1.5.4 Views and Templates
- python学习之--Django--初次使用templates
- GIT常用命令——入门必备
- 左偏树 Monkey King HDU-1512
- 7.规避脱离标准流的方法
- setsockopt中参数之SO_REUSEADDR的意义
- Hibernate的unsaved-value属性解读
- django 引用static templates
- socket网络通讯详细实现过程、解释
- 会场安排问题(贪心)
- C++之尽量少做转型动作(27)---《Effective C++》
- 阶乘之和
- git 常用命令
- Excel读取
- 7.26--SSH学习之SpringMVC控制器注释
- JS程序设计