Zhc1993 发表于 2015-03-02 11:55

TemplateSyntaxError Invalid block tag: 'static'

使用Django的static导入css文件,报错Invalid block tag: 'static'homepage.html:<% load staticfiles %>
<html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

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

    <h1> Django Blog</h1>
</html>
在project的settings.py里,已经install了staticfiles APPINSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'myblog',
    # Uncomment the next line to enable the admin:
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
但,还是提示static invalid tag,不知怎么搞的,如何查错?求教
页: [1]
查看完整版本: TemplateSyntaxError Invalid block tag: 'static'