Ckeditor在models.py django的简单博客中不能正常工作



my model.py

from django.contrib.auth.models import User
from ckeditor.fields import RichTextField #(this field imported)
# Create your models here.
class Blog_post(models.Model):
title = models.CharField(max_length=200)
body = models.RichTextField(blank=True) #(this field in body is not defined)
author = models.ForeignKey(User,on_delete=models.CASCADE)

和CKEditor已安装,我遵循的教程相同,但在我的情况下,每当我进入make migration它说名称RichTextField没有定义,我不知道如何修复它任何类型的帮助将被赞赏

我已经修复了它,我使用models.RichTextField()错误是抛出,因为RichTextField不是在模型中定义的,你应该只使用tex=RichTextField()这是一个打字错误- baibars313刚才

最新更新