Поле редактора Summernote стало нередактируемым в django
This is my second attempt to use summernote content editor. The first time I decided to use it in development, the editor functioned appropriately initially. I could type and upload images through the editor. But as I added more content to my website the editor stopped showing up on the admin page suddenly. the TextField
field that is supposed to use summernote became blank and uneditable. I know I didn't mess up with the setup I had for the summernote. Fixing it was more than a nightmare. For more than a month I was still battling with it, trying to make it editable but all efforts were wasted, I then removed summernote from my application. This time around I decided to use the content editor again and it worked after setting it up. After adding few more contents to the website I ran into the same issue as before, the field that is supposed to be using summernote suddely became uneditable as shown in the attached file:
Ниже представлены мои блоки кода
models.py
class blog_post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)
category = models.ForeignKey(Category, related_name="product", on_delete=models.CASCADE, null=True)
title = models.CharField(max_length=200)
slug = models.SlugField()
image = ResizedImageField(size=[1920, 1080], upload_to='images/blog/%Y/%m/%d/', null=True, blank=True)
introduction = models.CharField(max_length=255)
body = models.TextField()
featured = models.BooleanField(default=False)
likes = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name="likes", blank=True)
dislikes = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name="dislikes", blank=True)
published_date = models.DateTimeField(default=timezone.now, blank=True)
created_date = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
admin.py
from django.contrib import admin
from django_summernote.admin import SummernoteModelAdmin
from .models import Category, blog_post, blog_comment
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
list_display = ["name", "slug"]
prepopulated_fields = {"slug": ("name",)}
class blog_postAdmin(SummernoteModelAdmin):
list_display = ('id', 'title','slug', 'category', 'created_date')
search_fields = ('title', )
list_display_links = ('id', 'title')
summernote_fields = ('body',)
prepopulated_fields = {"slug": ("title",)}
admin.site.register(blog_post, blog_postAdmin)
settings.py
X_FRAME_OPTIONS = 'SAMEORIGIN'
Так ли работает summernote по умолчанию? Или, скорее, есть пакеты, с которыми summernote не совместим? Мне нравится редактор контента, и я хотел бы его использовать. Если проблема присуща summernote, пожалуйста, посоветуйте другой хороший редактор контента, который я могу использовать с django.