#๐Ÿ”’ FlaskWtf error with validation.

15 messages ยท Page 1 of 1 (latest)

regal hawk
#

Hello, I'm trying to make a Vaildation for the fields in my form, but for some reason
submit.on_validation() doesn't work.
By the way, the secret key provided is not my actual secret key.
This is the code

glacial yarrowBOT
#

@regal hawk

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tacit ibex
#

use os.getenv for storing secrets

#

If you won't print it, nobody will know it, also useful if you're going to upload it on github

regal hawk
#

Hey, most of the time I'm using environemntal variable.
By the way, what is app.config?

#

And can you maybe help me with the problem that I wrote?

tacit charm
#

Import and subclass FlaskForm, not from Form. Form is the parent class directly from wtforms and does not implement the method you are calling.

#

@regal hawk

regal hawk
#

so how it should look like?

tacit charm
#

Change your import to FlaskForm. Subclass from that.

regal hawk
#

Like this?

tacit charm
#

probably, yes

regal hawk
#

Thank you very much!!

glacial yarrowBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.