Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
First, we need to import our Article model from models.py. Remember to use .models to reference the models module in the
from django.http import HttpResponse from models import models.Article # Write your views here
Eduardo Valencia12,444 Points
If I remember this correctly, this should be
from .models import Article
.models tells Python to look into the same directory the file is in. The
models part tells it to look for the file called "models." Then, it imports "Article" from that file. You don't need to use
models.Article to reference it, just Article in this scenario.
Yeaup, did the trick. Thanks!
I can't select your answer as best answer.