当在settings.py中设置了如下

TEMPLATE_LOADERS=(
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)

则意味着:


所以,要在django项目目录下新建一个templates/jobs的路径,并把.html文件放在其下。(jobs为该project下的app)

而settings.py中的TEMPLATE_DIRS,以列表的方式给出templates所在的路径:

TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]

django-template-loader的更多相关文章

  1. django template

    一.模板基本元素 1.例子程序 1)urls.py中新增部分 from django.conf.urls import patterns, url, include urlpatterns = pat ...

  2. Django.template框架 template context (非常详细)

    前面的章节我们看到如何在视图中返回HTML,但是HTML是硬编码在Python代码中的 这会导致几个问题: 1,显然,任何页面的改动会牵扯到Python代码的改动 网站的设计改动会比Python代码改 ...

  3. django.template.exceptions.TemplateDoesNotExist: login.html 错误处理

    登陆Login界面时候报错 Internal Server Error: /login/ Traceback (most recent call last): File , in inner resp ...

  4. Django Template 进阶

    回顾: Variables {{ var }} {{ dict.key }} {{ var.attr }} {{ var.method }} {{ varindex }} Filter {{ list ...

  5. 四. django template模版

    往前端浏览器pull一些字符串,这些字符串是一些数据, 那如果想让这些数据按我们的某种格式美化一点/增加样式/图片,就需要用到django提供的模版--模版就是为了让数据看起更美观. 加载模版 dja ...

  6. django: template using & debug

    模板的作用方法有如下三种: blog/views.py: from django.template import loader, Context, Template from django.http ...

  7. django: template - built-in tags

    本节介绍模板中的内置标签:if for 承上文,修改 views.py 如下: from django.shortcuts import render_to_response class Person ...

  8. django: template variable

    模板变量用双大括号显示,如: <title>page title: {{title}}</title> 一 模板中使用变量 继续前面的例子,修改 index.html: < ...

  9. The Django template language 阅读批注

    The Django template language About this document This document explains the language syntax of the D ...

  10. Django Template模板

    Django Template 你可能已经注意到我们在例子视图中返回文本的方式有点特别. 也就是说,HTML被直接硬编码在 Python 代码之中. 下面我们来调用html views def ind ...

随机推荐

  1. Android 中文API (69) —— BluetoothAdapter[蓝牙]

    前言 本章内容是  android.bluetooth.BluetoothAdapter,为Android蓝牙部分的章节翻译.本地蓝牙设备的适配类,所有的蓝牙操作都要通过该类完成.版本为 Androi ...

  2. poj1144 Network【tarjan求割点】

    转载请注明出处,谢谢:http://www.cnblogs.com/KirisameMarisa/p/4319585.html   ---by 墨染之樱花 [题目链接]http://poj.org/p ...

  3. UNIX/Linux进程间通信IPC---管道--全总结(实例入门)

    管道 一般,进程之间交换信息的方法只能是经由fork或exec传送打开文件,或者通过文件系统.而进程间相互通信还有其他技术——IPC(InterProcessCommunication) (因为不同的 ...

  4. a标签阻止跳转的方法

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. LNMP安装包sh脚本

    Xshell 5 (Build 0719) Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved. Type `he ...

  6. cookie保存分页参数

    <script src="../Public/js/jquery.cookie.js"></script> <script type="te ...

  7. poj 1905 Expanding Rods 二分

    /** 题解晚上写 **/ #include <iostream> #include <math.h> #include <algorithm> #include ...

  8. JS常用方法函数(1)

    1.字符串长度截取 function cutstr(str, len) { var temp, icount = 0, patrn = /[^\x00-\xff]/, strre = "&q ...

  9. QT实现窗口缩放打开与关闭(重叠窗口,太有意思了)

    基本思想:假设A为主窗口,B为子窗口.A打开或关闭时,先对A窗口进行截图,然后将图片部满整个B窗口的,在paintEvent里面进行动态缩放或放大画图.最后使用动画,将B窗口以动画的形式打开或关闭,动 ...

  10. Android开发 第一篇

    关于android开发,new项目通知: 之前的new -> android project,现在更改为new -> android application project,同学们可以继续 ...