[Fixed]-I(1054, "Unknown column 'rango_category.slug' in 'field list'") Django

1👍

As you can see, you don’t have a slug field in you rango_category table.

In the corresponding model for the rango_category table, let’s say RangoCategory model add a slug field:

class RangoCategory(models.Model):
    id = ...
    likes = ...
    name = ...
    views = ...
    slug = models.SlugField()

Then run python manage.py makemigrations and python manage.py migrate, it will probably ask for a value to set to the existing rows.

This will create a slug field in you db table.

👤Gocht

Leave a comment