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 REST Framework RESTful Django Create Serializers

Tim Wicks
Tim Wicks
12,144 Points

Import models not working: module 'scorekeeper.serializers' has no attribute 'models'

My code: from scorekeeper.models import *

scorekeeper/serializers.py
from scorekeeper.models import Game, Player, Score
from rest_framework import serializers

1 Answer

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Tim,

Looking at the question, it is not asking you to import everything from scorekeeper.models nor is it asking you to import Game, Player and Score from scorekeeper.models.

It is asking you to:

import serializers from rest_framework

(which you have correct) and:

models from the current app.

(where your problem is). Remember, the current app is called scorekeeper. and the module you are importing is models.

Hope that points you in the right direction.

Cheers

Alex