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 trialChristopher Carucci
1,971 PointsFirst, we need to import our Article model from models.py. Remember to use .models to reference the models module in the
Grrrrrrrrrrrrr
from django.http import HttpResponse
from models import models.Article
# Write your views here
3 Answers
Eduardo Valencia
12,444 PointsIf I remember this correctly, this should be
from .models import Article
The .
in .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.
Christopher Carucci
1,971 PointsYeaup, did the trick. Thanks!
Christopher Carucci
1,971 PointsI can't select your answer as best answer.
Chris Freeman
Treehouse Moderator 68,454 PointsChris Freeman
Treehouse Moderator 68,454 PointsMoved comment to answer. Marked best answer.