flask-wtforms Questions

5

Solved

I have the following code and I'm submitting a form. When I hit the submit button, my form validation prints out False. I've checked and made sure I'm including everything from different posts, but...
Lyndsaylyndsey asked 6/4, 2016 at 1:42

7

I'm following a Flask tutorial from http://code.tutsplus.com/tutorials/intro-to-flask-adding-a-contact-page--net-28982 and am currently stuck on the validation step: The old version had the follow...
Cliftonclim asked 15/8, 2014 at 9:25

2

I've developed a web app that includes the functionality for users to log in and signup. I've done everything as per documentation and tutorials, and everything works fine with the flask server. ...
Engud asked 16/12, 2019 at 16:39

9

Solved

I am currently running a conda environment with flask-wtf version 0.14.2 and wtforms version 2.21 and I have trouble solving this ImportError: cannot import name 'url_encode' from 'werkzeug' The f...
Defend asked 28/3, 2020 at 3:44

7

Solved

A few days ago I have reset my local flask environment without having captured the dependencies via a pip freeze before I deleted it. Hence I had to re-install the latest version of the entire stac...
Salient asked 1/2, 2014 at 17:17

5

I have been trying to build a web app using flask and wtforms and a firebase database, but I keep getting the error message "KeyError: 'A secret key is required to use CSRF.'" and I don't know how ...

2

Does anyone know of a way to create a datalist field using WTForms in Flask? I know how to create a SelectField but I need to allow the user to enter their own value if it isn't in the list. This...
Gillum asked 27/1, 2016 at 22:47

5

I'm using flask_form in my Flask application and have being stucked for hours now with the 'CSRF Token do not match'. <form method="post" action="{{ url_for('auth.login') }}" role="form"> {...
Westland asked 12/9, 2017 at 8:24

1

this is a submit button code of a wtform: {{ form.submit(class="w-50 btn btn-primary btn-sm submit-btn") }} I am thinking of adding a class to it when it's clicked? i know a way of showing erro...
Cyb asked 20/9, 2018 at 7:6

3

Solved

I want to add or remove new WTForm input fields with button, using Jquery, just like here http://www.sanwebe.com/2013/03/addremove-input-fields-dynamically-with-jquery/comment-page-1 but using my f...
Assuntaassur asked 28/5, 2014 at 14:58

2

Solved

I have a multi-part form to generate - think similar workflow to a Shopping Cart where you have multiple "sections" (eg details, billing, payment etc) for the one form that display one at a time. ...
Hinson asked 18/11, 2015 at 0:6

2

Solved

I need to make a custom validator in WTForms where the input is to be: number:number - e.g. 2:1 match1 = StringField('Russia-Saudi Arabia', validators=[DataRequired()]) So, my question is - how ...
Elsaelsbeth asked 14/5, 2018 at 9:33

2

Solved

I have this field in the WTForms form name = StringField('Name', validators = [Optional(), Length(max = 100)]) When the field is submitted empty then form.name.data will, as expected, contain an...
Ilona asked 17/2, 2014 at 14:8

3

How can I set FileSizeLimit validation for flask_wtf.file.FileField?
Littman asked 20/4, 2021 at 4:22

3

Solved

I'm working with Flask-Marshmallow for validating request and response schemas in Flask app. I was able to do simple validations for request.form and request.args when there are simple fields like ...
Hedjaz asked 8/1, 2020 at 9:28

3

Solved

I am stumped on testing a POST to add a category to the database where I've used Flask_WTF for validation and CSRF protection. For the CRUD operations pm my website. I've used Flask, Flask_WTF and ...
Ish asked 1/6, 2016 at 21:52

3

Solved

I have created a signup form using wtforms. I am using FormField in it so that I don't have to repeat some of the elements of the form again. But whenever I click on the Submit button it always giv...
Stamin asked 10/9, 2013 at 10:49

1

I am trying to figure out a way to check if there is any built-in Form method that would return true if the form has been modified in Flask/WTForms I know that in Django Forms, we have that flexib...
Purdah asked 12/3, 2019 at 5:41

2

Here is my code: class ChangeOfficialForm(Form): is_official = SelectField( 'Officially Approved', choices=[(True, 'Yes'), (False, 'No')], validators=[DataRequired()], coerce=bool ) submit ...
Kaplan asked 30/10, 2015 at 5:52

4

Solved

I want to reset the form after it validates. Currently the form will still show the previous data after it is submitted and valid. Basically, I want the form to go back to the original state with a...
Niemeyer asked 11/8, 2015 at 15:0

4

What is the simplest way to assign 'disabled' html attribute to one of the options in SelectField in WTForms? This is my previous code <select class="form-control" name="division" data-error="...
Roddy asked 5/6, 2017 at 23:8

3

Solved

I get problem for disable csrf using flask-wtf for a restapi. The problem is similar like here: Flask-Restful POST fails due CSRF protection of Flask-WTF, but I use flask original instead of flask-...
Meingolda asked 16/2, 2019 at 2:10

4

I am using flask-wtforms to create a Textarea. body = TextAreaField('body') I want to change the value of the textarea which you can do in html like this. <textarea>other value then defau...
Shoreward asked 12/8, 2017 at 11:10

3

Solved

I'm using virtualenv to set up a new project. I installed a lot of things using virtualenv pip from the script folder like below: flask\scripts\pip install Flask-WTF I have no other packages ins...
Slab asked 18/8, 2013 at 8:10

5

I have a field in which the user is ask to input a year. My html looks like this <div class="form-group {% if form_search2.year_search.errors %} error {% endif %}" style="padding: 0px;"> &l...
Heedful asked 5/6, 2016 at 12:45

© 2022 - 2025 — McMap. All rights reserved.