Commits

Gregory Petukhov committed 74aee21

back to ckeditor

  • Participants
  • Parent commits 3e3ce73

Comments (0)

Files changed (2)

     * Add to INSTALLED_APPS::
 
         'sorl.thumbnail',
-        'tinymce',
+        'ckeditor',
 
     * Add to urls.py::
 
-        url(r'^tinymce/', include('tinymce.urls')),
+        url(r'^ckeditor/', include('ckeditor.urls')),
 
     * Add to settings.py::
-        TINYMCE_DEFAULT_CONFIG = {
-            'plugins': "table, spellchecker, paste, searchreplace, style, visualchars, pagebreak, fullscreen",
-            'theme': "advanced",
-            'cleanup_on_startup': True,
-            'custom_undo_redo_levels': 10,
-            'width': '70%',
-            'height': 300,
-            'theme_advanced_buttons1': \
-        'bold,italic,underline,strikethrough,justifyleft, \
-        justifycenter,justifyright,justifyfull,bullist, \
-        numlist,outdent,indent,cut,copy,paste,undo, \
-        redo,link,unlink,image,cleanup,help,code,hr, \
-        removeformat',
-        'theme_advanced_buttons2': 'formatselect,fontselect,fontsizeselect, \
-        styleselect,sub,sup,forecolor,backcolor,forecolorpicker, \
-        backcolorpicker,charmap,visualaid,anchor,newdocument, \
-        blockquote', 
-        'theme_advanced_buttons3': 'fullscreen, spellchecker, visualchars, styleprops, |, search, replace, |, pastetext, pasteword',
-        'theme_advanced_buttons4': 'tablecontrols, table, row_props, cell_props, delete_col, delete_row, col_after, col_before, row_after, row_before, split_cells, merge_cells',
+
+        CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'upload/ckeditor')
+        CKEDITOR_CONFIGS = {
+            'default': {
+                'toolbar': 'Full',
+                'width': 840,
+                'height': 300,
+                'toolbarCanCollapse': False,
+            }
         }
 
 * Install django-article application

File article/models.py

 # -*- coding: utf-8 -*-
 from datetime import datetime
 from south.modelsinspector import add_introspection_rules
-from tinymce.models import HTMLField
+from ckeditor.fields import RichTextField
 
 from django.db import models
 from django.core.urlresolvers import reverse
     title = models.CharField(max_length=255)
     slug = models.SlugField(max_length=255, blank=False, default=None)
     category = models.ForeignKey('article.Category', related_name='articles')
-    teaser = HTMLField(blank=True)
-    content = HTMLField()
+    teaser = RichTextField(blank=True)
+    content = RichTextField()
     image = models.ImageField(blank=True,
             upload_to='upload/article/article_image')
     meta_keywords = models.CharField(max_length=255, blank=True)