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 Django Basics Model Administration First app view

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

3 Answers

Eduardo Valencia
Eduardo Valencia
12,444 Points

If 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.

Yeaup, did the trick. Thanks!

I can't select your answer as best answer.