{ "info": { "author": "Piotr Malinski", "author_email": "riklaunim@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Django CKEditor\n===============\n* riklaunim / django-ckeditor is on PyPi as https://pypi.python.org/pypi/django-ckeditor-updated - latest code, works with latest Django\n* shaunsephton / django-ckeditor is on PyPi as https://pypi.python.org/pypi/django-ckeditor - still old release not compatible with newer Django versions\n\n\n**This fork, django-ckeditor-updated, has different configuration than the old django ckeditor. All of my changes were recently merged to shaunsephton repository\nbut they havent been released yet as a package. Until django-ckeditor won't get new and constant releases I'be maintaining this fork.***\n\n\n**Django admin CKEditor integration.**\nProvides a ``RichTextField`` and ``CKEditorWidget`` utilizing CKEditor with image upload and browsing support included.\n\n* This version also includes:\n#. support to django-storages (works with S3)\n#. updated ckeditor to version 4.4\n#. included all ckeditor language files to made everyone happy!\n\n.. contents:: Contents\n :depth: 5\n\nInstallation\n------------\n\nRequired\n~~~~~~~~\n#. Install or add django-ckeditor-updated to your python path. Note: You may not have the original django-ckeditor and django-ckeditor-updated installed at the same time.\n\n#. Add ``ckeditor`` to your ``INSTALLED_APPS`` setting.\n\n#. Add a CKEDITOR_UPLOAD_PATH setting to the project's ``settings.py`` file. This setting specifies an relative path to your CKEditor media upload directory. CKEditor uses Django storage API. By default Django uses file system storage backend (it will use your MEDIA_ROOT and MEDIA_URL) and if you don't use different backend you have to have write permissions for the CKEDITOR_UPLOAD_PATH path within MEDIA_ROOT, i.e.::\n\n\n CKEDITOR_UPLOAD_PATH = \"uploads/\"\n\n For the default file system storage images will be uploaded to \"uploads\" folder in your MEDIA_ROOT and urls will be created against MEDIA_URL (/media/uploads/image.jpg).\n\n CKEditor has been tested with django FileSystemStorage and S3BotoStorage.\n There are issues using S3Storage from django-storages.\n\n#. Run the ``collectstatic`` management command: ``$ /manage.py collectstatic``. This'll copy static CKEditor require media resources into the directory given by the ``STATIC_ROOT`` setting. See `Django's documentation on managing static files `_ for more info.\n\n#. Add CKEditor URL include to your project's ``urls.py`` file::\n\n (r'^ckeditor/', include('ckeditor.urls')),\n\n#. Set ``CKEDITOR_IMAGE_BACKEND`` to one of supported backends to enable thumbnails in ckeditor gallery. By default no thumbnails are created and full size images are used as preview. Supported backends:\n\n - ``pillow``: uses PIL or Pillow\n\n#. django-ckeditor uses jQuery in ckeditor-init.js file. You must set ``CKEDITOR_JQUERY_URL`` to a jQuery URL that will be used to load the library. If you have jQuery loaded from a different source just don't set this variable and django-ckeditor will not try to load its own jQuery. Example::\n\n CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'\n\n\nOptional\n~~~~~~~~\n#. All uploaded files are slugified by defaults, to disable this feature set ``CKEDITOR_UPLOAD_SLUGIFY_FILENAME`` to ``False``\n\n#. Set the CKEDITOR_RESTRICT_BY_USER setting to ``True`` in the project's ``settings.py`` file (default ``False``). This restricts access to uploaded images to the uploading user (e.g. each user only sees and uploads their own images). Superusers can still see all images. **NOTE**: This restriction is only enforced within the CKEditor media browser.\n\n#. Add a CKEDITOR_CONFIGS setting to the project's ``settings.py`` file. This specifies sets of CKEditor settings that are passed to CKEditor (see CKEditor's `Setting Configurations `_), i.e.::\n\n CKEDITOR_CONFIGS = {\n 'awesome_ckeditor': {\n 'toolbar': 'Basic',\n },\n }\n\n The name of the settings can be referenced when instantiating a RichTextField::\n\n content = RichTextField(config_name='awesome_ckeditor')\n\n The name of the settings can be referenced when instantiating a CKEditorWidget::\n\n widget = CKEditorWidget(config_name='awesome_ckeditor')\n\n By specifying a set named ``default`` you'll be applying its settings to all RichTextField and CKEditorWidget objects for which ``config_name`` has not been explicitly defined ::\n\n CKEDITOR_CONFIGS = {\n 'default': {\n 'toolbar': 'Full',\n 'height': 300,\n 'width': 300,\n },\n }\n\n\nUsage\n-----\n\nField\n~~~~~\nThe quickest way to add rich text editing capabilities to your models is to use the included ``RichTextField`` model field type. A CKEditor widget is rendered as the form field but in all other regards the field behaves as the standard Django ``TextField``. For example::\n\n from django.db import models\n from ckeditor.fields import RichTextField\n\n class Post(models.Model):\n content = RichTextField()\n\n\nWidget\n~~~~~~\nAlernatively you can use the included ``CKEditorWidget`` as the widget for a formfield. For example::\n\n from django import forms\n from django.contrib import admin\n from ckeditor.widgets import CKEditorWidget\n\n from post.models import Post\n\n class PostAdminForm(forms.ModelForm):\n content = forms.CharField(widget=CKEditorWidget())\n class Meta:\n model = Post\n\n class PostAdmin(admin.ModelAdmin):\n form = PostAdminForm\n\n admin.site.register(Post, PostAdmin)\n\nManagment Commands\n~~~~~~~~~~~~~~~~~~\nIncluded is a management command to create thumbnails for images already contained in ``CKEDITOR_UPLOAD_PATH``. This is useful to create thumbnails when starting to use django-ckeditor with existing images. Issue the command as follows::\n\n $ ./manage.py generateckeditorthumbnails\n\n**NOTE**: If you're using custom views remember to include ckeditor.js in your form's media either through ``{{ form.media }}`` or through a ``