0

When I run my Django project on production server, I have this error:

ProgrammingError at /admin/core/event/

column core_event.hometask does not exist
LINE 1: ..._event"."is_approved", "core_event"."event_type", "core_even...

What I should do to fix it? Now I haven't "hometask" field in my model:

class Event(models.Model):
    name = models.CharField(max_length=100, null=True)
    author = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    description = models.TextField(max_length=1000, blank=True, null=True)
    date_start = models.DateTimeField(null=True, blank=True)
    date_finish = models.DateTimeField(null=True, blank=True)

    image = models.ImageField(
        upload_to="event_images/", default='event_images/default.png', blank=True, null=True)
    is_approved = models.BooleanField(null=True)

    TYPE_CHOICES = (
        ('Event', "Мероприятие"),
        ('Lesson', "Урок"),
    )
    event_type = models.CharField(choices=TYPE_CHOICES, max_length=200, default="Мероприятие")
    topics = ArrayField(models.CharField(max_length=200), blank=True, null=True)
    materials = ArrayField(models.URLField(), blank=True, null=True)
    possible_users = models.ManyToManyField("core.User", blank=True, related_name='possible_users')
    actual_users = models.ManyToManyField("core.User", blank=True, related_name='actual_users')
    classes = models.ManyToManyField("core.Class", blank=True, related_name='classes')
abakunov
  • 133
  • 1
  • 1
  • 4

1 Answers1

0

From what you posted, looks like the field existed in the model before but not anymore. However, your admin.py still has reference to the old field of hometask.

So, go to admin.py, search for hometask, and remove it.

Jahongir Rahmonov
  • 13,083
  • 10
  • 47
  • 91