admin管理员组文章数量:1026728
I can succesfully Upload a file using:
<form method="post" enctype="multipart/form-data">.
However I can not combine this method with logging in my user.
I want to login my user using the render_form method:
{{ render_form(form, novalidate=True)}}
However, I can't find a way to support uploading a file with this method.
I can succesfully Upload a file using:
<form method="post" enctype="multipart/form-data">.
However I can not combine this method with logging in my user.
I want to login my user using the render_form method:
{{ render_form(form, novalidate=True)}}
However, I can't find a way to support uploading a file with this method.
Share Improve this question edited Nov 16, 2024 at 22:47 Ahrimann Steiner 1,3441 gold badge11 silver badges31 bronze badges asked Nov 16, 2024 at 16:35 user23568016user23568016 53 bronze badges 1- {{ wtf.quick_form(form,enctype="multipart/form-data") }} – Ahrimann Steiner Commented Nov 16, 2024 at 21:03
1 Answer
Reset to default 0 {% macro render_form(form, action) %}
{% from "_formhelpers.html" import render_field %}
<div id="Product" class="variant-block" style="display: block;">
{% from "_formhelpers.html" import render_field %}
{% import "bootstrap/wtf.html" as wtf %}
{{ wtf.quick_form(form,enctype="multipart/form-data") }}
</div>
{% endmacro %}
More info. here: https://bootstrap-flask.readthedocs.io/en/stable/macros/
I can succesfully Upload a file using:
<form method="post" enctype="multipart/form-data">.
However I can not combine this method with logging in my user.
I want to login my user using the render_form method:
{{ render_form(form, novalidate=True)}}
However, I can't find a way to support uploading a file with this method.
I can succesfully Upload a file using:
<form method="post" enctype="multipart/form-data">.
However I can not combine this method with logging in my user.
I want to login my user using the render_form method:
{{ render_form(form, novalidate=True)}}
However, I can't find a way to support uploading a file with this method.
Share Improve this question edited Nov 16, 2024 at 22:47 Ahrimann Steiner 1,3441 gold badge11 silver badges31 bronze badges asked Nov 16, 2024 at 16:35 user23568016user23568016 53 bronze badges 1- {{ wtf.quick_form(form,enctype="multipart/form-data") }} – Ahrimann Steiner Commented Nov 16, 2024 at 21:03
1 Answer
Reset to default 0 {% macro render_form(form, action) %}
{% from "_formhelpers.html" import render_field %}
<div id="Product" class="variant-block" style="display: block;">
{% from "_formhelpers.html" import render_field %}
{% import "bootstrap/wtf.html" as wtf %}
{{ wtf.quick_form(form,enctype="multipart/form-data") }}
</div>
{% endmacro %}
More info. here: https://bootstrap-flask.readthedocs.io/en/stable/macros/
本文标签: pythonUpload File with FlaskForm RenderformStack Overflow
版权声明:本文标题:python - Upload File with FlaskForm Render_form - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745651727a2161358.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论