Skip to main content

All Questions

Tagged with
0 votes
1 answer
21 views

Handling Flask WTForms Validation errors inside a bootstrap modal

I have dashboard endpoint where the user can view,edit,delete a campaign/form. <button hx-get="{{ url_for('campaign_action' , campaign_id=campaign.id , username=username) }}" ...
Javets M's user avatar
0 votes
1 answer
28 views

Unable to import WTForm class from one file to another

I am unable to import NamerForm from forms.py to controllers.py. Getting ImportError ImportError: cannot import NamerForm from application.forms File Directory structure: .venv |____applications |-...
HS077's user avatar
  • 11
0 votes
0 answers
30 views

How do I commit data from a flask form (inside of a modal) to an SQL Database?

I'm pretty new to Flask and struggling with transferring data from a form to an SQL Database. The form is within a modal, which works perfectly and will redirect back to the main page once the form is ...
This_Jello_5204's user avatar
0 votes
1 answer
28 views

How to use FileField within WTForms FieldList? Using Flask-WTF for FileField

I have created dynamic fields using WTForms FieldList, macros and Javascript. Using this code to validate many fields (StringField, SelectField etc) I can add many fields dynamically, and they ...
Artistica Digital's user avatar
2 votes
1 answer
140 views

Why does flask seem to require a redirect after POST?

I have an array of forms I want rendered in a flask blueprint called fans. I am using sqlalchemy to SQLLite during dev to persist the data and flask-wtforms to render. The issue appears to be with ...
dmcgrandle's user avatar
  • 6,022
0 votes
0 answers
26 views

CSRF token not validated for form with GET method

I'm trying to implement an anti-CSRF token in a dummy flask app with 2 forms in same page. CSRF token validation is working for POST form (route /change_password) but not for update email form (route /...
isoman's user avatar
  • 762
0 votes
0 answers
12 views

FlaskForm not rendering

I have register.html, index.html and base.html as below however, when i visit the route /register, the form does not appear. The below code also includes register route and RegistrationForm. I would ...
Shakib Duste's user avatar
0 votes
1 answer
24 views

Using Flask and WTForms, a SelectField has a dictionary of {label: list} pairs. On submtting the form, how can label of chosen item be accessed?

I have a SelectField in a form made with Flask and WTFforms. The SelectField is created with choices in a dictionary, {label:list}. The problem is: because in some of the lists within this dictionary ...
stumpsprout's user avatar
1 vote
0 answers
16 views

How to create multi-option BooleanField in wtforms under one label and a select all option with bootstrap-flask

I wanted to make a multi-option wtforms.BooleanField with one label in wtforms, flask_wtf this is the piece of code that I wrote: class InventoryRecorder(flask_wtf.FlaskForm): all_season = wtforms....
Besmella Kazimy's user avatar
0 votes
0 answers
35 views

CSRF Token is missing flask, flask_wtf, flutter

I have a Flask backend that serves both a Flutter app and a web app (Angular). The CSRF protection works fine for the Angular app because it is rendered through Flask. However, the Flutter app has a ...
Maverick's user avatar
0 votes
0 answers
30 views

When running the Flask app, the output showing it's running on localhost isn't printed in the terminal; it's redirected to the log file

* Serving Flask app 'app' * Debug mode: on These lines appear in the command line. * Running on http://127.0.0.1:5000 Press CTRL+C to quit * Restarting with stat * Debugger is active! * Debugger ...
Gaurav Yadav's user avatar
0 votes
1 answer
59 views

How to use multiple forms on the same page with Python/Flask?

I am trying to use two Flask forms on the same page. The first form gathers infos to list availables databases, which are passed on as choices to the "SelectField" of the second form. In my ...
GoodMorningStarshine's user avatar
0 votes
1 answer
34 views

Adding a new subform on click with flask_wtf

I have a form, made with flask_wtf. This form contains multiple fields. One of them is called plantes and is a FieldList of FormField. class InsertPlantesForm(FlaskForm): siterec=SelectField(label=...
eb18's user avatar
  • 15
0 votes
1 answer
32 views

I am getting 404 not found, what can I do?

I'm writting web-site on flask and I have a function to delete tournament, this how I call function in html: <form action="/delete_tournament/{{ tournament['tournament_id'] }}" method=&...
mizu fx's user avatar
0 votes
0 answers
21 views

Flask route params not being correctly passed when using wtf form

I have a route defined in a flask blueprint: @bp.route('/comparison', defaults={'category':'chatarra'}, methods=['GET']) @bp.route('/comparison/<string:category>', methods=['GET']) def ...
Milo2020's user avatar

15 30 50 per page
1
2 3 4 5
132