我正在使用django rest框架和django-ckeditor来创建带有描述的表单。我的问题是ckeditor工具栏丢失了,这是正常现象还是我需要添加一些功能使其显示? 在前端,如果要使用vue,是否应该再次将ckeditor添加到vue应用程序中?
from django.db import models
from . import CustomUser
from ckeditor.fields import RichTextField
class Blog(models.Model):
user = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
title = models.CharField(max_length=30, null=False)
description = RichTextField(blank=True, null=True)
class CreateBlogSerializer(serializers.ModelSerializer):
user = serializers.HiddenField(
default=serializers.CurrentUserDefault())
class Meta:
model = Blog
fields = ('user', 'title',
'description',
)
class BlogCreateView(generics.CreateAPIView):
queryset = Blog.objects.all()
serializer_class = CreateBlogSerializer
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated, Authorized_Company_User,)
我不确定是否可行,我在管理页面中找到了工具栏,但在api中却没有。