I'm working on a simple blog engine. Here is my initial 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 run python manage.py syncdb blog
, I get the error
'Module' Object Has no Attribute 'models'
I'm using sqlite3. I haven't set up any views or tests yet. In settings.py
, I have included the following apps:
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'blogApp',
'south',
Any ideas what could be going wrong here?
you have
author = models.models.models.ForeignKey(User)
that should probably be
author = models.ForeignKey(User)
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With