~/LargeApp
|-- run.py
|-- config.py
|__ /env # Virtual Environment
|__ /app # Our Application Module
|-- __init__.py
|-- /mod_auth # Our first module, mod_auth
|-- __init__.py
|-- controllers.py
|-- models.py
|-- forms.py
|-- /blog
|-- __init__.py
|-- controllers.py
|-- models.py
|-- forms.py
|__ /templates
|-- 404.html
|__ /auth
|-- signin.html
|__ /blog
|-- show_blog.html
|__ /static
|-- kube.css
|-- kube.js
/LargeApp/app/init.py
app.register_blueprint(auth)
app.register_blueprint(blog)
现在我在 templates/blog/show_blog 里面访问这个全局式的static文件夹里面的kube.css , 该如何访问??
还要在声明blog的蓝图的时候指定这个全局式的文件夹吗? 那样的话,所有的蓝图都访问这个全局的文件夹,都要指定吗?
蓝图模板访问静态文件和一般的没什么区别吧,
{{url_for('static', filename='kube.css')}}
不可以吗? 看你的目录,static目录默认是在LargeApp/static
, 模板目录默认也是和这个类似,你的模板如果没出问题,应该设置过了...我猜你这个静态目录应该也设置成了LargeApp/app/static
,这样静态文件访问应该是没问题的...