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 Making Strong Users Create a User model

Ron Tovbin
seal-mask
.a{fill-rule:evenodd;}techdegree
Ron Tovbin
Python Web Development Techdegree Student 6,268 Points

something wrong here. Not sure what I'm doing wrong.

Thank you kindly.

models.py
from peewee import *
from flask_bcrypt import check_password_hash
from flask_bcrypt import generate_password_hash


class User(Model):
     email = CharField(unique=True)
     password = CharField()
     join_date = DateField(default=datetime.datetime.now)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I feel like you're doing pretty well, but there's a few things going on here:

  • You do not need the bcrypt imports
  • You do need to import datetime
  • Your password field should have a max length of 100. It currently is not specified
  • join_date should be a DateTimeField instead of a DateField

Hope this helps! :sparkles: