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 SQLAlchemy Basics Introduction to SQLAlchemy Creating a Movie Model

Erroor:There should be a variable called engine set to create_engine(). Make sure you have 3 ///, the database named mov

There should be a variable called engine set to create_engine(). Make sure you have 3 ///, the database named movies.db, and echo set to False.

models.py
# First, import create_engine and declarative_base correctly from SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base

#Create a variable called engine and set it equal to create_engine. 
#Use create_engine to create a SQLite database called movies.db and set echo to False. 
#Next, create a variable named Base and set it equal to declarative_base. Then create the model class. 
#It should be called Movie, and it takes Base as an argument (it inherits from Base). 
#Inside of the class, set the __tablename__ to ’movies’.
engine = create_engie('sqlite:///movies.db', echo = False) 
Base = declarative_base()

class Movie(Base):
    __tablename__ = movies

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Hanwen Zhang, you are SO close. Look for the typo create_engie

The checker doesn’t like space before or after argument assignments. Use echo=False

There also seems to be an issue with the quote marks around “movie”. Notice in your post how the string “movie” isn’t the same color as the string used for create_engine?

Post back if you need more help. Good luck!!!

Thank you for catching my typos