我是使用mod_python.publisher 跟psp结合起来写的
现在的问题的是:生成的网页中的图片都没法显示,css文件没法使用
我的目录结构是:
test
|-------css
| |----common.css
| +----login.css
|
|-------templates
| |----- login.html
|
|-------images
|
+------ index.py
index.py:
from mod_python import psp
import os
TMPL_DIR = 'templates'
def index(req):
return login(req)
def login(req):
return psp.PSP(req, _tmpl_path('login.html'))
def _tmpl_path(name):
""" A shorthand for building a full path to a template """
return os.path.join(TMPL_DIR, name)
def _any_page(req, filename, title):
vars = {'headExtra': "",
'title': title,
'menu': psp.PSP(req, _tmpl_path("menu_body.html")),
'body': psp.PSP(req, _tmpl_path("%s_body.html" % filename))
}
return psp.PSP(req, _tmpl_path("common.html"), vars = vars)
login.html中的css文件链接应该怎么写呢?以下两种写法都没用
<link rel="StyleSheet" href="../css/login.css" type="text/css">
和
<link rel="StyleSheet" href="css/login.css" type="text/css">