我正在尝试Flask-Assets
加载我的资产。
我的CSS在这里:/home/myname/projects/py/myapp/myapp/static/css/lib/somecsslib.css
默认情况下,它会在错误的目录中查找。我明白了:
No such file or directory: '/home/myname/projects/py/myapp/static/css/lib/somecsslib.css'
我正在正常初始化它;
assets = Environment(app)
我尝试设置load_path
:
assets.load_path = '/home/myname/projects/py/myapp/myapp/static/'
当我这样做时,我收到以下错误:
BundleError: 'css/lib/somecsslib.css' not found in load path: /home/myname/projects/py/myapp/myapp/static/
编辑
我刚刚发现这load_path
是一个list
.
我尝试了这个:
assets.load_path.append('/home/myname/projects/py/myapp/myapp/static/')
结果我得到了这个:
BuildError: [Errno 2] No such file or directory: '/css/lib/somecsslib.css'