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 Broadcasting Post Model

Christian Basile
Christian Basile
2,067 Points

weird thing about peewee, database attribute not properly configured error

I would appreciate your help. Thank you!!

File "app.py", line 228, in <module> models.initialize() File "/Users/christianbasile/Desktop/Sflask/models.py", line 86, in initialize DATABASE.create_tables([User, Post, Relationship, Liketable], safe=True) File "/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/peewee.py", line 3286, in create_tables model.create_table(**options) File "/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/peewee.py", line 6590, in create_table if safe and not cls._schema.database.safe_create_index \ File "/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/peewee.py", line 5521, in database 'be set on the model: %s' % self.model) peewee.ImproperlyConfigured: database attribute does not appear to be set on the model: <Model: Post> (base) Christians-MacBook-Pro:Sflask christianbasile$