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 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,478 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).