Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 33e4427

Browse files
committed
Update and merge the documentation
1 parent da62d57 commit 33e4427

File tree

10 files changed

+542
-236
lines changed

10 files changed

+542
-236
lines changed

CHANGELOG.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Changelog
22
=========
33

4+
Next version
5+
------------
6+
#. Fix storage problems by setting ``CKEDITOR_BASEPATH`` (hopefully for real
7+
this time)
8+
#. Documentation updates
9+
#. Added a ``CKEDITOR_RESTRICT_BY_DATE`` setting to add uploaded files into
10+
folders containing the current date.
11+
#. Added a ``CKEDITOR_FILEICONS`` setting that allows overriding the
12+
icons used by Gallerific.
13+
#. Added a ``CKEDITOR_FILENAME_GENERATOR`` setting which allows
14+
specifying a callable which mangles the filename of uploaded files.
15+
#. Added ``THUMBNAIL_SIZE`` and ``IMAGE_QUALITY`` settings for the
16+
Pillow image backend.
17+
#. Actually include static assets for ``ckeditor_uploader`` in the
18+
pip-installable package.
19+
420
5.2.2
521
-----
622
#. Django 1.11 support
@@ -59,8 +75,8 @@ Changelog
5975
File upload support have been moved to ckeditor_uploader. The urls are in ckeditor_uploader.urls while for file uploading widget you have to use RichTextUploadingField from ckeditor_uploader.fields instead of RichTextField from from ckeditor.fields.
6076

6177
#. Updated ckeditor to 4.5.3 (from https://github.com/ckeditor/ckeditor-dev/tree/4.5.3)
62-
#. Added new plugins from ckeditor maintainers: adobeair, ajax, autoembed, autogrow, autolink, bbcode, codesnippet, codesnippetgeshi, devtools, divarea, docprops, embed, embedbase, embedsemantic, filetools, iframedialog, image2, language, lineutils, mathjax, menubutton, notification, notificationaggregator, placeholder, sharedspace, sourcedialog, stylesheetparser, tableresize, uicolor, uploadimage, uploadwidget, widget, xml
63-
#. Add `zip_safe=False` on setup config, to force does not create ".egg" file
78+
#. Added new plugins from ckeditor maintainers: adobeair, ajax, autoembed, autogrow, autolink, bbcode, codesnippet, codesnippetgeshi, devtools, divarea, docprops, embed, embedbase, embedsemantic, filetools, iframedialog, image2, language, lineutils, mathjax, menubutton, notification, notificationaggregator, placeholder, sharedspace, sourcedialog, stylesheetparser, tableresize, uicolor, uploadimage, uploadwidget, widget, xml
79+
#. Add `zip_safe=False` on setup config, to force does not create ".egg" file
6480
#. Add python Wheel package configuration
6581
#. Add setup.py functions to easy release ".egg" package and Wheel package, and tag version on git ( ``python setup.py publish`` and ``python setup.py tag`` )
6682
#. Improved Tox configuration to code coverage check, code quality check (flake8), imports order check (isort) and test with django master branch

README.rst

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ File upload support has been moved to ckeditor_uploader. The urls are in ckedit
1010
**Django admin CKEditor integration.**
1111
Provides a ``RichTextField``, ``RichTextUploadingField``, ``CKEditorWidget`` and ``CKEditorUploadingWidget`` utilizing CKEditor with image uploading and browsing support included.
1212

13-
* This version also includes:
13+
This version also includes:
14+
1415
#. support to django-storages (works with S3)
1516
#. updated ckeditor to version 4.6.1
1617
#. included all ckeditor language and plugin files to made everyone happy! ( `only the plugins maintained by the ckeditor develops team <https://github.com/ckeditor/ckeditor-dev/tree/4.6.1/plugins>`_ )
1718

1819
.. contents:: Contents
19-
:depth: 5
20+
:depth: 5
2021

2122
Installation
2223
------------
@@ -72,11 +73,35 @@ Required for using widget with file upload
7273

7374
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
7475

75-
#. Note that by adding those URLs you add views that can upload and browse through uploaded images. Since django-ckeditor 4.4.6, those views are staff_member_required. If you want a different permission decorator (login_required, user_passes_test etc.) then add views defined in `ckeditor.urls` manually to your urls.py.
76+
#. Note that by adding those URLs you add views that can upload and browse through uploaded images. Since django-ckeditor 4.4.6, those views are decorated using ``@staff_member_required``. If you want a different permission decorator (``login_required``, ``user_passes_test`` etc.) then add views defined in ``ckeditor.urls`` manually to your urls.py.
7677

7778
#. Set ``CKEDITOR_IMAGE_BACKEND`` to one of the supported backends to enable thumbnails in ckeditor gallery. By default no thumbnails are created and full size images are used as preview. Supported backends:
7879

79-
- ``pillow``: uses PIL or Pillow
80+
- ``pillow``: Uses Pillow
81+
82+
#. django-ckeditor uses Django admin's jQuery by default. You may override this
83+
by specifying a different jQuery as ``CKEDITOR_JQUERY_URL``. If you find
84+
that CKEditor widgets don't appear in your Django admin site then check that
85+
this variable is set correctly. Example::
86+
87+
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
88+
89+
#. CKEditor needs to know where its assets are located because it loads them
90+
lazily only when needed. The location is determined by looking at a script
91+
tag which includes a URL ending in ``ckeditor.js``. This does not work all
92+
the time, for example when using ``ManifestStaticFilesStorage``, any asset
93+
packaging pipeline or whatnot. django-ckeditor is quite good at
94+
automatically detecting the correct place even then, but sometimes you have
95+
to hardcode ``CKEDITOR_BASEPATH`` somewhere. It is recommended to override
96+
the ``admin/base_site.html`` template with your own if you really need to do
97+
this, i.e.::
98+
99+
{% extends "admin/base_site.html" %}
100+
101+
{% block extrahead %}
102+
<script>window.CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/';</script>
103+
{{ block.super }}
104+
{% endblock %}
80105

81106

82107
Optional - customizing CKEditor editor
@@ -238,13 +263,15 @@ The image/file upload feature is done by the `uploadimage` plugin.
238263

239264
Restricting file upload
240265
-----------------------
266+
241267
#. To restrict upload functionality to image files only, add ``CKEDITOR_ALLOW_NONIMAGE_FILES = False`` in your settings.py file. Currently non-image files are allowed by default.
242268

243269
#. By default the upload and browse URLs use staff_member_required decorator - ckeditor_uploader/urls.py - if you want other decorators just insert two urls found in that urls.py and don't include it.
244270

245271

246272
Demo / Test application
247273
-----------------------
274+
248275
If you clone the repository you will be able to run the ``ckeditor_demo`` application.
249276

250277
#. ``pip install -r ckeditor_demo_requirements.txt``
@@ -262,6 +289,7 @@ Database is set to sqlite3 and STATIC/MEDIA_ROOT to folders in temporary directo
262289

263290
Running selenium test
264291
---------------------
292+
265293
You can run the test with ``python manage.py test ckeditor_demo`` (for repo checkout only) or with ``tox`` which is configured to run with Python 2.7 and 3.4.
266294

267295

@@ -285,6 +313,7 @@ More on https://docs.djangoproject.com/en/1.11/ref/clickjacking/#setting-x-frame
285313

286314
Example ckeditor configuration
287315
------------------------------
316+
288317
::
289318

290319
CKEDITOR_CONFIGS = {
@@ -333,22 +362,21 @@ Example ckeditor configuration
333362
# 'toolbarCanCollapse': True,
334363
# 'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
335364
'tabSpaces': 4,
336-
'extraPlugins': ','.join(
337-
[
338-
'uploadimage', # the upload image feature
339-
# your extra plugins here
340-
'div',
341-
'autolink',
342-
'autoembed',
343-
'embedsemantic',
344-
'autogrow',
345-
# 'devtools',
346-
'widget',
347-
'lineutils',
348-
'clipboard',
349-
'dialog',
350-
'dialogui',
351-
'elementspath'
352-
]),
365+
'extraPlugins': ','.join([
366+
'uploadimage', # the upload image feature
367+
# your extra plugins here
368+
'div',
369+
'autolink',
370+
'autoembed',
371+
'embedsemantic',
372+
'autogrow',
373+
# 'devtools',
374+
'widget',
375+
'lineutils',
376+
'clipboard',
377+
'dialog',
378+
'dialogui',
379+
'elementspath'
380+
]),
353381
}
354382
}

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

docs/INSTALL.md

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)