- 论坛徽章:
- 2
|
使用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 APP- INSTALLED_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,不知怎么搞的,如何查错?求教 |
|