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

I keep getting a error when I go into the console

This is the error

File "/home/treehouse/workspace/learning_site/courses/models.py", line 4, in <module>
class Course(models.model):
AttributeError: module 'django.db.models' has no attribute 'model'

and this is my models.py file

from django.db import models

Create your models here.

class Course(models.model): created_at = models.DateTimeField(auto_now_add=True) title = models.Charfield(max_length=255) description = models.TextField()

1 Answer

Instead of models.model, try models.Model

You might also want to replace models.Charfield with models.CharField