Answer the question
In order to leave comments, you need to log in
Why does CKEditor display information incorrectly?
I am writing a Django project using CKEditor. In the editor itself, I write the title and text of the article, attach pictures. It looks like this:
However, when the page loads, I see the following:
What is my problem?
models.py
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from ckeditor_uploader.fields import RichTextUploadingField
class News(models.Model):
title = models.CharField(max_length=250)
slug = models.SlugField(max_length=50,unique=True)
author = models.ForeignKey(User,on_delete=models.CASCADE,
related_name='news_posts', null=True, blank=True)
anons = models.CharField(max_length=350)
body = RichTextUploadingField(null=True, blank=True)
date_added = models.DateTimeField(auto_now_add=True)
# Возврат понятного отображения заголовка в панель администрирования
def __str__(self):
return self.title
class Meta:
verbose_name = u"Новость"
verbose_name_plural = u"Новости"
path('ckeditor/', include('ckeditor_uploader.urls')),
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = '/media/'
CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'None'
},
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question