所以在开发过程中每件事都运行正常,但是一旦我进行eb部署,这个问题就会再次发生。我的代码中没有related_cat。
ProgrammingError at /admin/main/category/
column main_category.parent_cat_id does not exist
LINE 1: ...n_category"."author_id", "main_category"."image", "main_cate...
^
class Category(models.Model):
name = models.CharField(max_length=128, unique=True)
description = models.TextField(verbose_name=('community'))
author = models.ForeignKey(settings.AUTH_USER_MODEL)
image = models.ImageField(upload_to='images/', null=True, blank=True, verbose_name=('image'))
# parent_cat = models.ForeignKey('self', null=True, blank=True)
hotCat = models.BooleanField(default=False)
active = models.BooleanField(default=True)
sponsored = models.ForeignKey(Sponsored, null=True, blank=True)
objects = CategoryManager()
def __unicode__(self):
return self.name
def get_absolute_url(self):
return "/category/%s/" %self.name
def get_image_url(self):
return "%s%s" %(settings.MEDIA_URL, self.image)