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 trialArihant Jain
306 PointsGetting an Error
After Running i got:
peewee.OperationalError: database is locked
1 Answer
Josh Roberts
9,930 PointsKenneth Love answers this under the Macros video. Once you add the line "with DATABASE.transaction():" The error should go away.
@classmethod def create_user(cls, username, email, password, admin=False): try: with DATABASE.transaction(): cls.create( username=username, email=email, password=generate_password_hash(password), is_admin=admin) except IntegrityError: raise ValueError("User already exists")
Ikuyasu Usui
36 PointsIkuyasu Usui
36 PointsYou see 'social.db' that has created when you run app.py on the directory. Just delete the file. Then, you run app.py again: (python app.py). It will go through.