django.db.utils.OperationalError: no such column: media_mediamodule.article_pill

**Just to be clear, I have read all other articles on and they’re all a billion years ago and Django has made several revisions since these posts were posted. **

So, I had decide to add a new views to my Django model name MediaModule.

Previously, and as per procedure, you add a new field, give is a default value to it can populate the new field with a value for all existing objects in your Model – which makes sense – and you;re as happy as Larry (however happy Larry may be).

However, today, Django has decided to tell me that, basically, my new field does not exist:

django.db.utils.OperationalError: no such column: media_mediamodule.article_pill

This takes place when I run py manage.py makemigrations

So what did I try?

Well, apart from selling my sanity, I thought it was a migrations issue, so I deleted all migration files from the migrations folder and deleted everything except for the __init__.py file.

I commented out the “offending” field, & it has no issue.

I checked the database schema and it returned the following result:

('CREATE TABLE "media_mediamodule" ("uuid" char(32) NOT NULL PRIMARY KEY, "article_headline" varchar(100) NOT NULL, "article_body" text NOT NULL, "article_synopsis" text NULL, "article_journalist" varchar(20) NOT NULL, "article_date" datetime NOT NULL, "article_image" varchar(100) NOT NULL, "article_image_summary" text NULL, "article_identifier" varchar(50) NOT NULL UNIQUE)',)
>>> 

But if course it wouldn’t include the new field because it would not allow me to further diagnose the issue until I removed the offending field.

Why is this happening? I have cleared the cache, I have cleared the migration history and initiated a new migration and I have added a default field so existing model objects can have this new field populated. I am doing everything correctly

The use of the model works with no issues but why is Django having some sort of nervous breakdown every time I try and insert a new object model? It’s just silly.

This is my models.py file

from django.db import models
import uuid, random, string

def generate_unique_id(charlimit):
    '''This will generate a random set of numbers and letters which will be used to generate a unique URL for each object in the model.
    '''
    random_string = ''.join(random.choices(string.ascii_lowercase + string.digits, k=charlimit))  # Generates a random string
    return f"{random_string}"

def generate_unique_uuid():
    '''This will generate a random set of numbers and letters which are to be derrived from the UUID methodology, which will be used to generate a unique URL for each object in the model.
    '''
    return str(uuid.uuid4())[:8]

# Create your models here.
class MediaModule(models.Model):
    uuid                   =    models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) 
    article_identifier     =    models.CharField(max_length=50, default=generate_unique_id(12), unique=True, editable=False)
    article_headline       =    models.CharField(max_length=100)
    article_body           =    models.TextField()
    article_synopsis       =    models.TextField(null=True)
    article_journalist     =    models.CharField(max_length=20)
    article_date           =    models.DateTimeField(auto_now=True)
    article_image          =    models.ImageField(upload_to='assets')
    article_image_summary  =    models.TextField(default="", null=True, blank=True)
    article_pill           =    models.TextField(default="", null=True, max_length=225) ##this is the field Django has an issue with

    def __str__(self):
        return self.article_headline 

The things I have tried are listed above.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật