免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3398 | 回复: 0
打印 上一主题 下一主题

TemplateSyntaxError Invalid block tag: 'static' [复制链接]

论坛徽章:
2
申猴
日期:2014-07-17 10:05:182015年迎新春徽章
日期:2015-03-04 09:58:11
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-03-02 11:55 |只看该作者 |倒序浏览
使用Django的static导入css文件,报错Invalid block tag: 'static'homepage.html:
  1. <% load staticfiles %>
  2. <html>
  3.     <head>
  4.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.         <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

  6.         <title>zhuhaichao Django Blog </title>
  7.         <!-- style START -->
  8.         <link rel="stylesheet" href="{% static 'myblog/style.css' %}" type="text/css" media="screen" />
  9.         
  10.     </head>

  11.     <h1> Django Blog</h1>
  12. </html>
复制代码
在project的settings.py里,已经install了staticfiles APP
  1. INSTALLED_APPS = (
  2.     'django.contrib.auth',
  3.     'django.contrib.contenttypes',
  4.     'django.contrib.sessions',
  5.     'django.contrib.sites',
  6.     'django.contrib.messages',
  7.     'django.contrib.staticfiles',
  8.     'django.contrib.admin',
  9.     'myblog',
  10.     # Uncomment the next line to enable the admin:
  11.     # Uncomment the next line to enable admin documentation:
  12.     # 'django.contrib.admindocs',
  13. )
复制代码
但,还是提示static invalid tag,不知怎么搞的,如何查错?求教
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP