问题标签 [flask-bootstrap]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
49 浏览

flask - 在烧瓶中导入引导模板的问题

我是烧瓶的新手,刚开始训练后,我就碰壁了……

项目结构如下:

如您所见,有两个base.html文件,都包含不同的源代码。但是,让我们从顶部开始。

start.py

templates/bootstrap/base.html

templates/base.html

index.html

user.html

问题是,尽管index.htmluser.htmlextend templates/base.htmltemplates/bootstrap/base.html定义导航栏和相关组件的代码却无处可寻。而且,在templates/base.html任何地方都看不到。事实上,如果定义了用户名,应用程序会正确处理用户名,如果 URL 指向index.html页面,则会出现问候语,404 错误也会得到正确处理,但没有bootstrap加载任何组件。此外,根本没有bootstrap样式,基本字体是Times New Roman

有没有绝对路径的东西?在拆分代码以实现 DRY 假设之前,我必须补充一点,一切正常。看起来我搞砸了进口,但不知道在哪里。