简体   繁体   English

不更新字段

[英]Wagtail not updating field

I am using wagtail and after modifying a field to use duration instead of price , wagtail still shows the field as price . 我正在使用w,将字段修改为使用duration而不是price ,w仍然将字段显示为price

I've run makemigrations and migration command and the database column is updated but the wagtail admin still has the old field displayed. 我已经运行了makemigrationsmigration命令,并且数据库列已更新,但makemigrations管理员仍然显示了旧字段。

How can I fix it? 我该如何解决?

class InfoPage(Page):
    title = models.CharField(max_length=300, help_text='title')
    duration = models.PositiveSmallIntegerField(help_text='Duration')

    content_panels = Page.content_panels + [
        FieldPanel('title'),
        FieldPanel('duration')
    ]

如果您正在生产中运行网站,则Django可能正在使用缓存的模板加载器 ,在这种情况下,您需要在运行迁移后重新启动应用服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM