Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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


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
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 ;)