DatabaseError: value too long for type character varying(100)

后端 未结 11 554
北恋
北恋 2021-01-31 02:37

I have a Django web site running a mini CMS we\'ve built internally years ago, it\'s using postgresql. When saving a simple title and a paragraph of text I get the following err

11条回答
  •  半阙折子戏
    2021-01-31 03:07

    I can bet money you have a models.SlugField without length set. The default length is 50 characters, most likely it's not enough for your use case.

    Change it to models.SlugField(max_length=255) and migrate your database schema.

提交回复
热议问题