<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>《使用Bootstrap-Flask在Flask项目中集成Bootstrap》的评论</title>
	<atom:link href="https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/feed/" rel="self" type="application/rss+xml" />
	<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/</link>
	<description>一个编程和写作爱好者的在线记事本</description>
	<lastBuildDate>Wed, 05 Nov 2025 16:05:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.26</generator>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-18922</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Wed, 03 Aug 2022 01:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-18922</guid>
		<description><![CDATA[请教一下，如何使用bootstrap-flask实现定时轮询某接口功能，比如我要实现监控功能，需要每n秒对相关接口进行查询更新页面状态，使用bootstrap-flask应该如何实现呢。]]></description>
		<content:encoded><![CDATA[<p>请教一下，如何使用bootstrap-flask实现定时轮询某接口功能，比如我要实现监控功能，需要每n秒对相关接口进行查询更新页面状态，使用bootstrap-flask应该如何实现呢。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-9364</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Wed, 17 Nov 2021 10:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-9364</guid>
		<description><![CDATA[问题已解决，感谢，urlfor可以传参数]]></description>
		<content:encoded><![CDATA[<p>问题已解决，感谢，urlfor可以传参数</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-9358</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Wed, 17 Nov 2021 10:00:33 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-9358</guid>
		<description><![CDATA[您好，请教一下，我在使用table时想点击新增的Action同时传递一个参数。
但是使用new_url=url_for不支持传递参数，url_for只能传一个URL，请问如何实现点击新增的+时同事给跳转的接口传递一个参数呢？]]></description>
		<content:encoded><![CDATA[<p>您好，请教一下，我在使用table时想点击新增的Action同时传递一个参数。<br />
但是使用new_url=url_for不支持传递参数，url_for只能传一个URL，请问如何实现点击新增的+时同事给跳转的接口传递一个参数呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-8471</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Fri, 29 Oct 2021 01:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-8471</guid>
		<description><![CDATA[明白 十分感谢！]]></description>
		<content:encoded><![CDATA[<p>明白 十分感谢！</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-8268</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Thu, 21 Oct 2021 11:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-8268</guid>
		<description><![CDATA[在渲染之前，在视图函数里，你可以给具体的表单字段设置默认值。比如：

form = UserForm()
user = User.query.from_db()
form.usernme.data = user.username
form.bio.data = user.bio]]></description>
		<content:encoded><![CDATA[<p>在渲染之前，在视图函数里，你可以给具体的表单字段设置默认值。比如：</p>
<p>form = UserForm()<br />
user = User.query.from_db()<br />
form.usernme.data = user.username<br />
form.bio.data = user.bio</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-8262</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Thu, 21 Oct 2021 01:06:33 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-8262</guid>
		<description><![CDATA[我目前是在bootsrap-flask渲染完成后，用js取Form内每个元素的ID，单独进行赋值处理，不知道是否有更简便优雅一点的方式]]></description>
		<content:encoded><![CDATA[<p>我目前是在bootsrap-flask渲染完成后，用js取Form内每个元素的ID，单独进行赋值处理，不知道是否有更简便优雅一点的方式</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-8248</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Wed, 20 Oct 2021 11:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-8248</guid>
		<description><![CDATA[比如我用render_field，如何在渲染这个字段时给输入款自动填写上默认值，我看https://bootstrap-flask.readthedocs.io/en/stable/macros.html#中没有这个功能的参数。]]></description>
		<content:encoded><![CDATA[<p>比如我用render_field，如何在渲染这个字段时给输入款自动填写上默认值，我看https://bootstrap-flask.readthedocs.io/en/stable/macros.html#中没有这个功能的参数。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Djz</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-8246</link>
		<dc:creator><![CDATA[Djz]]></dc:creator>
		<pubDate>Wed, 20 Oct 2021 11:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-8246</guid>
		<description><![CDATA[李老师您好，bootstrap-flask框架的表单模块，如何在渲染模板时自动填写一些返显的值呢？]]></description>
		<content:encoded><![CDATA[<p>李老师您好，bootstrap-flask框架的表单模块，如何在渲染模板时自动填写一些返显的值呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-7617</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Wed, 31 Mar 2021 23:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-7617</guid>
		<description><![CDATA[这里的 index 视图函数并没有向模板里传递一个 form 变量。你需要在视图函数里实例化对应表单类，然后把实例对象传递到模板里:

def index():
&#160;&#160;&#160;&#160;form = MyForm()
&#160;&#160;&#160;&#160;return render_template(&#039;index.html&#039;, form=form)]]></description>
		<content:encoded><![CDATA[<p>这里的 index 视图函数并没有向模板里传递一个 form 变量。你需要在视图函数里实例化对应表单类，然后把实例对象传递到模板里:</p>
<p>def index():<br />
&nbsp;&nbsp;&nbsp;&nbsp;form = MyForm()<br />
&nbsp;&nbsp;&nbsp;&nbsp;return render_template(&#8216;index.html&#8217;, form=form)</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：psb</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-7607</link>
		<dc:creator><![CDATA[psb]]></dc:creator>
		<pubDate>Tue, 16 Mar 2021 02:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-7607</guid>
		<description><![CDATA[jinja2.exceptions.UndefinedError: &#039;form&#039; is undefined  

以下
app.py代码：
from flask_bootstrap import Bootstrap
from flask import Flask,render_template

from flask_sqlalchemy import SQLAlchemy

import config

app = Flask(__name__)
bootstrap = Bootstrap(app)
@app.route(&#039;/&#039;)
def index():
    return render_template(&#039;index.html&#039;)

index.html代码：
{% from &#039;bootstrap/form.html&#039; import render_field, render_hidden_errors %}


    {{ form.hidden_tag() }}
    {{ render_hidden_errors(form) }}
    {{ render_field(form.username) }}
    {{ render_field(form.password) }}
    {{ render_field(form.submit) }}
]]></description>
		<content:encoded><![CDATA[<p>jinja2.exceptions.UndefinedError: &#8216;form&#8217; is undefined  </p>
<p>以下<br />
app.py代码：<br />
from flask_bootstrap import Bootstrap<br />
from flask import Flask,render_template</p>
<p>from flask_sqlalchemy import SQLAlchemy</p>
<p>import config</p>
<p>app = Flask(__name__)<br />
bootstrap = Bootstrap(app)<br />
@app.route(&#8216;/&#8217;)<br />
def index():<br />
    return render_template(&#8216;index.html&#8217;)</p>
<p>index.html代码：<br />
{% from &#8216;bootstrap/form.html&#8217; import render_field, render_hidden_errors %}</p>
<p>    {{ form.hidden_tag() }}<br />
    {{ render_hidden_errors(form) }}<br />
    {{ render_field(form.username) }}<br />
    {{ render_field(form.password) }}<br />
    {{ render_field(form.submit) }}</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-7599</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Sat, 20 Feb 2021 12:21:24 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-7599</guid>
		<description><![CDATA[很明显，你同时安装了 Flask-Bootstrap 和 Bootstrap-Flask。你需要依次执行下面这两条命令（先卸载两者，然后重新安装 Bootstrap-Flask）：

pip uninstall bootstrap-flask flask-bootstrap
pip install bootstrap-flask]]></description>
		<content:encoded><![CDATA[<p>很明显，你同时安装了 Flask-Bootstrap 和 Bootstrap-Flask。你需要依次执行下面这两条命令（先卸载两者，然后重新安装 Bootstrap-Flask）：</p>
<p>pip uninstall bootstrap-flask flask-bootstrap<br />
pip install bootstrap-flask</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：yuan</title>
		<link>https://greyli.com/integrate-bootstrap-in-flask-application-with-bootstrap-flask/#comment-7598</link>
		<dc:creator><![CDATA[yuan]]></dc:creator>
		<pubDate>Sat, 20 Feb 2021 11:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://greyli.com/?p=1751#comment-7598</guid>
		<description><![CDATA[(flask-database) D:\flask-database&#062;pip list
Package          Version
---------------- -------
Bootstrap-Flask  1.5.1
click            7.1.2
dominate         2.6.0
Faker            6.3.0
Flask            1.1.2
Flask-Bootstrap  3.3.7.1
Flask-SQLAlchemy 2.4.4
Flask-WTF        0.14.3
itsdangerous     1.1.0
Jinja2           2.11.3
MarkupSafe       1.1.1
pip              20.3.1
python-dateutil  2.8.1
setuptools       51.1.2
six              1.15.0
SQLAlchemy       1.3.23
text-unidecode   1.3
visitor          0.1.3
Werkzeug         1.0.1
wheel            0.36.2
WTForms          2.3.3]]></description>
		<content:encoded><![CDATA[<p>(flask-database) D:\flask-database&gt;pip list<br />
Package          Version<br />
&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;-<br />
Bootstrap-Flask  1.5.1<br />
click            7.1.2<br />
dominate         2.6.0<br />
Faker            6.3.0<br />
Flask            1.1.2<br />
Flask-Bootstrap  3.3.7.1<br />
Flask-SQLAlchemy 2.4.4<br />
Flask-WTF        0.14.3<br />
itsdangerous     1.1.0<br />
Jinja2           2.11.3<br />
MarkupSafe       1.1.1<br />
pip              20.3.1<br />
python-dateutil  2.8.1<br />
setuptools       51.1.2<br />
six              1.15.0<br />
SQLAlchemy       1.3.23<br />
text-unidecode   1.3<br />
visitor          0.1.3<br />
Werkzeug         1.0.1<br />
wheel            0.36.2<br />
WTForms          2.3.3</p>
]]></content:encoded>
	</item>
</channel>
</rss>
