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
Daniel Santos
34,969 PointsPyMySQL: Already Closed, any help?
Hi Kenneth Love,
I am doing this project is an inventory for mysql and I am using peewee with MySQL. I had to install PyMySQL to have peewee working with MySQL. So, I am using your instructions from your Social Network with Flask to use users, and when I attempt to register an user PyMySQL raises an error:
pymysql.err.Error: Already closed
Do you or anyone knows why is this happening?
-Dan
1 Answer
Daniel Santos
34,969 PointsGot it, I was closing the database twice, because my after_request() view was closing it and I was closing it again in my controllers. BUMMER!