Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Build a Social Network with Flask Takin' Names Flask-WTF Forms

nuri jeon
nuri jeon
14,376 Points

Difference between flask_wtf and wtforms

Kenneth said that we first install flask_wtf and we import Form from it (from flask_wtf import Form) and next I had to import fields(ex. DataRequired, Regex) I had no problem doing that but I get to wonder what is the difference between flask_wtf and wtforms Does one belong to other package? or are they just two different packages doing different things? Thanks :P

1 Answer

Nicolas Hampton
Nicolas Hampton
44,626 Points

Nuri,

wtforms is a form validation library for python apps. It ties together your app framework, your database, and your templating engine to make validation workflow easier, and isn't specific to flask.

flask_wtf is the package that specifically makes tying wtforms into flask super simple. It works with wtforms, and is sort of like an addon for ease of use.

Ayman Said
seal-mask
.a{fill-rule:evenodd;}techdegree
Ayman Said
Python Web Development Techdegree Student 14,717 Points

Nicolas Hampton , just one correction on wtform, it better be defined as form input handling and validation, and not a form validation library as it includes more ;)