I've installed django-ckeditor on django 1.5 as instructed in the docs. I've changed TextField in my applications models.py to RichTextField as said in the docs. However I still see blank textarea in the Django admin instead of the ckeditor. This question was asked 3 years ago and none of the answers worked for me. The ckeditor.js loads just fine when I get the page. Any suggestions? my app name is newsfeed.
models.py:
from cms.models.pluginmodel import CMSPlugin from cms.models import Page from django.db import models from time import time from ckeditor.fields import RichTextField def get_upload_file_name(instance, filename): return "uploaded_files/%s_%s" % (str(time()).replace('.','_'),filename) # Create your models here. class NewsFeed (models.Model): title = models.CharField(('Feed Name'),max_length=200,help_text=('Feed name is visible only in edit mode')) publisher = models.CharField(('Publisher'),max_length=200) def __unicode__(self): return self.title def get_absolute_url(self): return "/newsfeed/get/%i" % self.id class NewsItem(models.Model): feed_id = models.ForeignKey(NewsFeed) title = models.CharField(('Title'),max_length=200) subtitle = models.CharField(('Sub-Title'),max_length=350,help_text=('Subtitles are displayed in auto-scroller and has max characters of 350')) #body = models.TextField(('Content'),blank=True,help_text=('Content is NOT visible in auto-scroller !')) body = RichTextField() url = models.URLField(("Link"), blank=True, null=True) page_link = models.ForeignKey(Page, verbose_name=("page"), blank=True, null=True, help_text=("A link to a page has priority over a text link.")) pub_date = models.DateTimeField('Publish Date') is_published = models.BooleanField(('Published'), default=False) class NewsFeedPlugin(CMSPlugin): newsfeed = models.ForeignKey(NewsFeed)
admin.py:
from django.contrib import admin from newsfeed.models import NewsFeed,NewsItem from cms.admin.placeholderadmin import PlaceholderAdmin class NewsItemInline(admin.StackedInline): model = NewsItem extra=0 class NewsFeedAdmin(admin.ModelAdmin): inlines = [NewsItemInline] class Media: js = ('ckeditor/ckeditor/ckeditor.js') admin.site.register(NewsFeed,NewsFeedAdmin)
config.js from ckeditor:
/** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; };