PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
STATICFILES_DIRS = (
os.path.join(PROJECT_PATH, 'static'),
)此代码返回以下错误消息:
WindowsError: [Error 267] The directory name is invalid我不明白这段代码出了什么问题。我尝试删除逗号,但得到另一个错误:Your STATICFILES_DIRS setting is not a tuple or list; perhaps you forgot a trailing comma?
另外,当我插入一个静态路径时,我得到了这个错误:
STATICFILES_DIRS = (
'F:/DEV/apps/myproject/static/',
)当我从STATICFILES_DIRS中删除路径时,我没有得到任何错误,网站工作正常:
STATICFILES_DIRS = () #no error如有任何帮助,我们不胜感激!谢谢!
发布于 2014-04-28 01:33:45
在PROJECT_PATH中使用dirname,而不是使用abspath。
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))https://stackoverflow.com/questions/23317201
复制相似问题