'Module' object has no attribute attribute error in django

I am working on a simple blog engine. Here is my source code for the models:

from django.db import models
from django.contrib.auth.models import User

class Entry(models.Model):

    title = models.CharField(max_length=80)
    author = models.models.models.ForeignKey(User)
    pubdate = models.DateTimeField()
    text = models.TextField()
    tags = models.ManyToManyField(Tag)


class Tag(models.Model):
    name = models.CharField(max_length=25)

class Comment(models.Model):
    author = models.ForeignKey(User)
    pubdate = models.DateTimeField()
    text = models.TextField()

When I try to start python manage.py syncdb blog, I get an error

'Module' Object Has no Attribute 'models'

I am using sqlite3. I have not created any views or tests yet. As settings.pyI turned on the following applications:

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'blogApp',
'south',

Any ideas what might be wrong here?

+5
source share
1 answer

you have

author = models.models.models.ForeignKey(User)

which probably should be

author = models.ForeignKey(User)

instead.

+7
source

All Articles