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 A Social Network with Flask Takin' Names Macros

Error messages are pop ups rather than statements that indicate what is wrong

I think it's good to mention I'm trying to replicate all of this work on PyCharm because I want it to be local. That said, things are appearing differently when I run the app.

Picture for reference: https://imgur.com/a/pfbv8zV

I'm assuming Flask has gone through many updates considering flask.ext doesn't seem to work when I run it locally. Any ideas what could've happened?

2 Answers

I was expecting an error for the username to appear as "Username should be one word, letters, numbers, and underscores only"

Andy Hughes
Andy Hughes
8,113 Points

For anyone else working on this outside of the TeamTreeHouse workspace editor, Flask has now updated a bunch of times and so if you copy the code into something like PyCharm or VSCode, you're going to get errors and missing modules etc.

So far the biggest changes as of 11/2021 are:

  1. from flask import Form should now be "from flask import FlaskForm". Then every reference in a class or function should also use "FlaskForm" instead of "Form".
  2. You may get an error saying you need to install and email_validator. So, just do "pip install email_validator" and you should be good.
  3. flask.ext.wtforms has now been superceded with flask_wtforms as have the other .ext references.
  4. validate_on_submit won't work without you doing step 1, as far I can tell.

That's what I've found so far (I'm using VS Code as I want to be able to code outside of workspaces).