开发 · 6月 20, 2022 0

解决wagtailmenus.FlatMenu: (models.W042) Auto-created primary key used when not defining a primary key type, by default ‘django.db.models.AutoField’. HINT: Configure the DEFAULT_AUTO_FIELD setting or the WagtailMenusConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. ‘django.db.models.BigAutoField’.

内容纲要

WARNINGS:

wagtailmenus.FlatMenu: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the WagtailMenusConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

settings文件夹下面的内容可解决

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
%d 博主赞过: