I am using django to create a blog. It is installed inside a virtual environment and django-tagging has been installed. I'm doing DB migrations with south and everything seems to work ok with my migrations, but it seems the tagging tables are not being created, so when I go to add a blog post via the admin I get the famous postgresql error:
Exception Type: DatabaseError at /admin/bppsite/blogpost/add/
Exception Value: relation "tagging_tag" does not exist
LINE 1: ...ECT "tagging_tag"."id", "tagging_tag"."name" FROM "tagging_t...
Here is relevant parts of my models.py:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^tagging\.fields\.TagField"])
from tagging.models import Tag
from tagging.fields import TagField
class BlogPost(models.Model):
title = models.CharField(max_length = 255)
text = models.TextField()
author = models.ForeignKey(User)
created = models.DateTimeField(auto_now_add = True)
modified = models.DateTimeField(auto_now = True)
status = models.CharField(max_length = 10, choices=POST_STATUS_CHOICES, default='DRAFT')
slug = models.SlugField(max_length = 255, blank=True)
category = models.ManyToManyField(Category)
tags = TagField()
def __unicode__(self):
return self.title
class Meta:
ordering = ["-created"]
def save(self):
if not self.id:
self.slug = slugify(self.title)
super(BlogPost, self).save()
def set_tags(self, tags):
Tag.objects.update_tags(self, tags)
def get_tags(self, tags):
return Tag.objects.get_for_object(self)
and, installed apps from settings.py:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'south',
'tinymce',
'tagging',
'bppsite',
)
I have tried moving the ordering of the apps around in INSTALLED_APPS (thinking the tagging might need to come before my app) but it doesn't seem to make any difference.
I know it's going to be something simple but can't figure it out.
thanks Aaron