Chinaunix

标题: TemplateSyntaxError Invalid block tag: 'static' [打印本页]

作者: Zhc1993    时间: 2015-03-02 11:55
标题: TemplateSyntaxError Invalid block tag: 'static'
使用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,不知怎么搞的,如何查错?求教




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2