METADATA 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934
  1. Metadata-Version: 2.1
  2. Name: django-ckeditor
  3. Version: 6.7.2
  4. Summary: Django admin CKEditor integration.
  5. Home-page: https://github.com/django-ckeditor/django-ckeditor
  6. Author: Shaun Sephton & Piotr Malinski
  7. Author-email: riklaunim@gmail.com
  8. Project-URL: Documentation, https://django-ckeditor.readthedocs.io/en/latest/
  9. Project-URL: Source, https://github.com/django-ckeditor/django-ckeditor
  10. Classifier: Programming Language :: Python
  11. Classifier: Programming Language :: Python :: 3.8
  12. Classifier: Programming Language :: Python :: 3.9
  13. Classifier: Programming Language :: Python :: 3.10
  14. Classifier: Programming Language :: Python :: 3.11
  15. Classifier: Programming Language :: Python :: 3.12
  16. Classifier: License :: OSI Approved :: BSD License
  17. Classifier: Operating System :: OS Independent
  18. Classifier: Framework :: Django
  19. Classifier: Framework :: Django :: 3.2
  20. Classifier: Framework :: Django :: 4.1
  21. Classifier: Framework :: Django :: 4.2
  22. Classifier: Framework :: Django :: 5.0
  23. Classifier: Intended Audience :: Developers
  24. Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
  25. Requires-Python: >=3.8
  26. License-File: LICENSE
  27. Requires-Dist: Django>=3.2
  28. Requires-Dist: django-js-asset>=2.0
  29. Deprecation notice
  30. ==================
  31. I do not recommend using this package anymore since the open source version of CKEditor 4 has unfixed security issues. More on this in `my blog post <https://406.ch/writing/django-ckeditor/>`__. Alternatives are listed `here on Django Packages <https://djangopackages.org/grids/g/wysiwyg/>`__. I personally am using `django-prose-editor <https://406.ch/writing/django-prose-editor-prose-editing-component-for-the-django-admin/>`__. Thanks!
  32. Django CKEditor
  33. ===============
  34. .. image:: https://img.shields.io/pypi/v/django-ckeditor.svg
  35. :target: https://pypi.python.org/pypi/django-ckeditor
  36. .. image:: https://img.shields.io/pypi/pyversions/django-ckeditor.svg
  37. :target: https://pypi.org/project/django-ckeditor/
  38. .. image:: https://img.shields.io/pypi/djversions/django-ckeditor.svg
  39. :target: https://pypi.org/project/django-ckeditor/
  40. .. image:: https://github.com/django-ckeditor/django-ckeditor/workflows/Tests/badge.svg
  41. :target: https://github.com/django-ckeditor/django-ckeditor/actions
  42. .. image:: https://readthedocs.org/projects/django-ckeditor/badge/?version=latest&style=flat
  43. :target: https://django-ckeditor.readthedocs.io/en/latest/
  44. **Django admin CKEditor integration.**
  45. Provides a ``RichTextField``, ``RichTextUploadingField``, ``CKEditorWidget`` and ``CKEditorUploadingWidget`` utilizing CKEditor with image uploading and browsing support included.
  46. This version also includes:
  47. #. support to django-storages (works with S3)
  48. #. updated ckeditor to version 4.18.0
  49. #. included all ckeditor language and plugin files to make everyone happy! ( `only the plugins maintained by the ckeditor develops team <https://github.com/ckeditor/ckeditor-dev/tree/4.6.2/plugins>`__ )
  50. .. contents:: Contents
  51. :depth: 5
  52. Installation
  53. ------------
  54. Required
  55. ~~~~~~~~
  56. #. Install or add django-ckeditor to your python path.
  57. ::
  58. pip install django-ckeditor
  59. #. Add ``ckeditor`` to your ``INSTALLED_APPS`` setting.
  60. #. Run the ``collectstatic`` management command: ``$ ./manage.py collectstatic``. This will copy static CKEditor required media resources into the directory given by the ``STATIC_ROOT`` setting. See `Django's documentation on managing static files <https://docs.djangoproject.com/en/dev/howto/static-files>`__ for more info.
  61. #. CKEditor needs to know where its assets are located because it loads them
  62. lazily only when needed. The location is determined in the ``ckeditor-init.js``
  63. script. and defaults to ``static/ckeditor/ckeditor/``. This does not work all
  64. the time, for example when using ``ManifestStaticFilesStorage``, any asset
  65. packaging pipeline or whatnot. django-ckeditor is quite good at automatically
  66. detecting the correct place even then, but sometimes you have to hardcode
  67. ``CKEDITOR_BASEPATH`` somewhere. This can be hardcoded in settings, i.e.::
  68. CKEDITOR_BASEPATH = "/my_static/ckeditor/ckeditor/"
  69. It is possible to override
  70. the ``admin/change_form.html`` template with your own if you really need to do
  71. this, i.e.::
  72. {% extends "admin/change_form.html" %}
  73. {% block extrahead %}
  74. <script>window.CKEDITOR_BASEPATH = '/my_static/ckeditor/ckeditor/';</script>
  75. {{ block.super }}
  76. {% endblock %}
  77. Of course, you should adapt this snippet to your needs when using
  78. CKEditor outside the admin app.
  79. Required for using widget with file upload
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. #. Add ``ckeditor_uploader`` to your ``INSTALLED_APPS`` setting.
  82. #. Add a ``CKEDITOR_UPLOAD_PATH`` setting to the project's ``settings.py`` file. This setting specifies a relative path to your CKEditor media upload directory. CKEditor uses Django's storage API. By default, Django uses the file system storage backend (it will use your ``MEDIA_ROOT`` and ``MEDIA_URL``) and if you don't use a different backend you have to have write permissions for the ``CKEDITOR_UPLOAD_PATH`` path within ``MEDIA_ROOT``, i.e.::
  83. CKEDITOR_UPLOAD_PATH = "uploads/"
  84. When using 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``).
  85. If you want to be able to have control over filename generation, you have to add a custom filename generator to your settings::
  86. # utils.py
  87. def get_filename(filename, request):
  88. return filename.upper()
  89. ::
  90. # settings.py
  91. CKEDITOR_FILENAME_GENERATOR = 'utils.get_filename'
  92. CKEditor has been tested with django FileSystemStorage and S3BotoStorage.
  93. There are issues using S3Storage from django-storages.
  94. #. For the default filesystem storage configuration, ``MEDIA_ROOT`` and ``MEDIA_URL`` must be set correctly for the media files to work (like those uploaded by the ckeditor widget).
  95. #. Add CKEditor URL include to your project's ``urls.py`` file::
  96. path('ckeditor/', include('ckeditor_uploader.urls')),
  97. #. 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.
  98. Optional - customizing CKEditor editor
  99. --------------------------------------
  100. #. 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 <http://docs.ckeditor.com/#!/guide/dev_configuration>`__), i.e.::
  101. CKEDITOR_CONFIGS = {
  102. 'awesome_ckeditor': {
  103. 'toolbar': 'Basic',
  104. },
  105. }
  106. The name of the settings can be referenced when instantiating a RichTextField::
  107. content = RichTextField(config_name='awesome_ckeditor')
  108. The name of the settings can be referenced when instantiating a CKEditorWidget::
  109. widget = CKEditorWidget(config_name='awesome_ckeditor')
  110. 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 ::
  111. CKEDITOR_CONFIGS = {
  112. 'default': {
  113. 'toolbar': 'full',
  114. 'height': 300,
  115. 'width': 300,
  116. },
  117. }
  118. It is possible to create a custom toolbar ::
  119. CKEDITOR_CONFIGS = {
  120. 'default': {
  121. 'toolbar': 'Custom',
  122. 'toolbar_Custom': [
  123. ['Bold', 'Italic', 'Underline'],
  124. ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
  125. ['Link', 'Unlink'],
  126. ['RemoveFormat', 'Source']
  127. ]
  128. }
  129. }
  130. If you want or need plugins which are not part of django-ckeditor's
  131. plugin set you may specify assets and plugins as follows::
  132. text = RichTextField(
  133. config_name='forum-post',
  134. # CKEDITOR.config.extraPlugins:
  135. extra_plugins=['someplugin'],
  136. # CKEDITOR.plugins.addExternal(...)
  137. external_plugin_resources=[(
  138. 'someplugin',
  139. '/static/.../path-to-someplugin/',
  140. 'plugin.js',
  141. )],
  142. )
  143. Alternatively, those settings can also be provided through
  144. ``CKEDITOR_CONFIGS``.
  145. Optional for file upload
  146. ~~~~~~~~~~~~~~~~~~~~~~~~
  147. #. All uploaded files are slugified by default. To disable this feature, set ``CKEDITOR_UPLOAD_SLUGIFY_FILENAME`` to ``False``.
  148. #. 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). Upload paths are prefixed by the string returned by ``get_username``. If ``CKEDITOR_RESTRICT_BY_USER`` is set to a string, the named property is used instead. Superusers can still see all images. **NOTE**: This restriction is only enforced within the CKEditor media browser.
  149. #. Set the ``CKEDITOR_BROWSE_SHOW_DIRS`` setting to ``True`` to show directories on the "Browse Server" page. This enables image grouping by directory they are stored in, sorted by date.
  150. #. Set the ``CKEDITOR_RESTRICT_BY_DATE`` setting to ``True`` to bucked uploaded files by year/month/day.
  151. #. You can set a custom file storage for CKEditor uploader by defining it under ``CKEDITOR_STORAGE_BACKEND`` variable in settings.
  152. #. You can set ``CKEDITOR_IMAGE_BACKEND`` to one of the supported backends to enable thumbnails in ckeditor gallery.
  153. By default, no thumbnails are created and full-size images are used as preview.
  154. Supported backends:
  155. - ``ckeditor_uploader.backends.PillowBackend``: Uses Pillow
  156. #. With the ``PillowBackend`` backend, you can change the thumbnail size with the ``CKEDITOR_THUMBNAIL_SIZE`` setting (formerly ``THUMBNAIL_SIZE``).
  157. Default value: (75, 75)
  158. #. With the ``PillowBackend`` backend, you can convert and compress the uploaded images to jpeg, to save disk space.
  159. Set the ``CKEDITOR_FORCE_JPEG_COMPRESSION`` setting to ``True`` (default ``False``)
  160. You can change the ``CKEDITOR_IMAGE_QUALITY`` setting (formerly ``IMAGE_QUALITY``), which is passed to Pillow:
  161. The image quality, on a scale from 1 (worst) to 95 (best). The default is 75. Values above 95
  162. should be avoided; 100 disables portions of the JPEG compression algorithm and results in
  163. large files with hardly any gain in image quality.
  164. This feature is disabled for animated images.
  165. Usage
  166. -----
  167. Field
  168. ~~~~~
  169. The 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 like the standard Django ``TextField``. For example::
  170. from django.db import models
  171. from ckeditor.fields import RichTextField
  172. class Post(models.Model):
  173. content = RichTextField()
  174. **For file upload support** use ``RichTextUploadingField`` from ``ckeditor_uploader.fields``.
  175. Widget
  176. ~~~~~~
  177. Alternatively, you can use the included ``CKEditorWidget`` as the widget for a formfield. For example::
  178. from django import forms
  179. from django.contrib import admin
  180. from ckeditor.widgets import CKEditorWidget
  181. from post.models import Post
  182. class PostAdminForm(forms.ModelForm):
  183. content = forms.CharField(widget=CKEditorWidget())
  184. class Meta:
  185. model = Post
  186. fields = '__all__'
  187. class PostAdmin(admin.ModelAdmin):
  188. form = PostAdminForm
  189. admin.site.register(Post, PostAdmin)
  190. **For file upload support** use ``CKEditorUploadingWidget`` from ``ckeditor_uploader.widgets``.
  191. **Overriding widget template**
  192. In Django >=1.11 for overriding ``ckeditor/widget.html`` you have three ways:
  193. #. Place ``ckeditor/widget.html`` in ``BASE_DIR/templates``
  194. - Change ``FORM_RENDERER`` to ``TemplateSettings``.
  195. ::
  196. FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
  197. - Include ``templates`` folder in ``DIRS``
  198. ::
  199. TEMPLATES = [{
  200. ...
  201. 'DIRS': [os.path.join(BASE_DIR, 'templates'), ],
  202. ...
  203. }]
  204. - Add ``'django.forms'`` to ``INSTALLED_APPS``.
  205. #. Place ``ckeditor/widget.html`` in ``your_app/templates`` and place ``'your_app'`` **before** ``'ckeditor'`` and ``'ckeditor_uploader'`` in ``INSTALLED_APPS``.
  206. #. Inherit from ``CKEditorWidget`` and override ``template_name`` with a custom template available in TEMPLATES DIRS as defined settings.py.
  207. ::
  208. class MyCustomCKEditorWidget(CKEditorWidget):
  209. template_name = "templates/custom_ckeditor/widget.html"
  210. Outside of django admin
  211. ~~~~~~~~~~~~~~~~~~~~~~~
  212. When you are rendering a form outside the admin panel, you'll have to make sure all form media is present for the editor to work. One way to achieve this is like this::
  213. <form>
  214. {{ myform.media }}
  215. {{ myform.as_p }}
  216. <input type="submit"/>
  217. </form>
  218. or you can load the media manually as it is done in the demo app::
  219. {% load static %}
  220. <script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
  221. <script type="text/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>
  222. When you need to render ``RichTextField``'s HTML output in your templates safely, just use ``{{ content|safe }}``, `Django's safe filter <https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#std:templatefilter-safe>`_
  223. Management Commands
  224. ~~~~~~~~~~~~~~~~~~~
  225. Included is a management command to create thumbnails for images already contained in ``CKEDITOR_UPLOAD_PATH``. This is useful to create thumbnails when using django-ckeditor with existing images. Issue the command as follows::
  226. $ ./manage.py generateckeditorthumbnails
  227. **NOTE**: If you're using custom views remember to include ckeditor.js in your form's media either through ``{{ form.media }}`` or through a ``<script>`` tag. Admin will do this for you automatically. See `Django's Form Media docs <http://docs.djangoproject.com/en/dev/topics/forms/media/>`__ for more info.
  228. Using S3
  229. ~~~~~~~~
  230. See https://django-storages.readthedocs.org/en/latest/
  231. **NOTE:** ``django-ckeditor`` will not work with S3 through ``django-storages`` without this line in ``settings.py``::
  232. AWS_QUERYSTRING_AUTH = False
  233. If you want to use allowedContent
  234. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  235. To get allowedContent to work, disable **stylesheetparser** plugin.
  236. So include this in your settings.py.::
  237. CKEDITOR_CONFIGS = {
  238. "default": {
  239. "removePlugins": "stylesheetparser",
  240. }
  241. }
  242. Plugins:
  243. --------
  244. django-ckeditor includes the following ckeditor plugins, but not all are enabled by default::
  245. a11yhelp, about, adobeair, ajax, autoembed, autogrow, autolink, bbcode, clipboard, codesnippet,
  246. codesnippetgeshi, colordialog, devtools, dialog, div, divarea, docprops, embed, embedbase,
  247. embedsemantic, filetools, find, flash, forms, iframe, iframedialog, image, image2, language,
  248. lineutils, link, liststyle, magicline, mathjax, menubutton, notification, notificationaggregator,
  249. pagebreak, pastefromword, placeholder, preview, scayt, sharedspace, showblocks, smiley,
  250. sourcedialog, specialchar, stylesheetparser, table, tableresize, tabletools, templates, uicolor,
  251. uploadimage, uploadwidget, widget, wsc, xml
  252. The image/file upload feature is done by the `uploadimage` plugin.
  253. Restricting file upload
  254. -----------------------
  255. #. 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.
  256. #. 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.
  257. Demo / Test application
  258. -----------------------
  259. If you clone the repository you will be able to run the ``ckeditor_demo`` application.
  260. #. ``pip install -r ckeditor_demo_requirements.txt``
  261. #. Run ``python manage.py migrate``
  262. #. Create a superuser if you want to test the widget in the admin panel
  263. #. Start the development server.
  264. There is a forms.Form on the main page (/) and a model in admin that uses the widget for a model field.
  265. Database is set to sqlite3 and STATIC/MEDIA_ROOT to folders in temporary directory.
  266. Running selenium test
  267. ---------------------
  268. The recommended way to run selenium tests is using tox. Select the appropriate
  269. selenium driver using the ``SELENIUM`` environment variable and optionally
  270. specify that you want to run only one environment since selenium takes some
  271. time and/or since you do not have all supported versions of Python installed
  272. locally. The example uses the combination of Python 3.9 and Django 4.0 which is
  273. a supported combination at the time of writing::
  274. # Either
  275. SELENIUM=firefox tox -e py39-dj40
  276. # Or
  277. SELENIUM=chromium tox -e py39-dj40
  278. # Or even
  279. SELENIUM=firefox tox
  280. Troubleshooting
  281. ---------------
  282. If your browser has problems displaying uploaded images in the image upload window you may need to change Django settings:
  283. ::
  284. X_FRAME_OPTIONS = 'SAMEORIGIN'
  285. More on https://docs.djangoproject.com/en/1.11/ref/clickjacking/#setting-x-frame-options-for-all-responses
  286. Example ckeditor configuration
  287. ------------------------------
  288. ::
  289. CKEDITOR_CONFIGS = {
  290. 'default': {
  291. 'skin': 'moono',
  292. # 'skin': 'office2013',
  293. 'toolbar_Basic': [
  294. ['Source', '-', 'Bold', 'Italic']
  295. ],
  296. 'toolbar_YourCustomToolbarConfig': [
  297. {'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
  298. {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
  299. {'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
  300. {'name': 'forms',
  301. 'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
  302. 'HiddenField']},
  303. '/',
  304. {'name': 'basicstyles',
  305. 'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
  306. {'name': 'paragraph',
  307. 'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
  308. 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
  309. 'Language']},
  310. {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
  311. {'name': 'insert',
  312. 'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
  313. '/',
  314. {'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']},
  315. {'name': 'colors', 'items': ['TextColor', 'BGColor']},
  316. {'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
  317. {'name': 'about', 'items': ['About']},
  318. '/', # put this to force next toolbar on new line
  319. {'name': 'yourcustomtools', 'items': [
  320. # put the name of your editor.ui.addButton here
  321. 'Preview',
  322. 'Maximize',
  323. ]},
  324. ],
  325. 'toolbar': 'YourCustomToolbarConfig', # put selected toolbar config here
  326. # 'toolbarGroups': [{ 'name': 'document', 'groups': [ 'mode', 'document', 'doctools' ] }],
  327. # 'height': 291,
  328. # 'width': '100%',
  329. # 'filebrowserWindowHeight': 725,
  330. # 'filebrowserWindowWidth': 940,
  331. # 'toolbarCanCollapse': True,
  332. # 'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
  333. 'tabSpaces': 4,
  334. 'extraPlugins': ','.join([
  335. 'uploadimage', # the upload image feature
  336. # your extra plugins here
  337. 'div',
  338. 'autolink',
  339. 'autoembed',
  340. 'embedsemantic',
  341. 'autogrow',
  342. # 'devtools',
  343. 'widget',
  344. 'lineutils',
  345. 'clipboard',
  346. 'dialog',
  347. 'dialogui',
  348. 'elementspath'
  349. ]),
  350. }
  351. }
  352. AUTHORS
  353. =======
  354. Created By
  355. ----------
  356. #. `shaunsephton <http://github.com/shaunsephton>`__
  357. Contributors
  358. ------------
  359. #. `riklaunim <https://github.com/riklaunim>`__
  360. #. `3point2 <https://github.com/3point2>`__
  361. #. `buchuki <http://github.com/buchuki>`__
  362. #. `chr15m <http://github.com/chr15m>`__
  363. #. `hedleyroos <https://github.com/hedleyroos>`__
  364. #. `jeffh <https://github.com/jeffh>`__
  365. #. `lihan <https://github.com/lihan>`__
  366. #. `loop0 <http://github.com/loop0>`__
  367. #. `mwcz <https://github.com/mwcz>`__
  368. #. `tomwys <https://github.com/tomwys>`__
  369. #. `snbuback <https://github.com/snbuback>`__
  370. #. And others `<https://github.com/django-ckeditor/django-ckeditor/graphs/contributors>`__
  371. Changelog
  372. =========
  373. Unreleased
  374. ----------
  375. 6.7.2
  376. -----
  377. #. **Deprecated the package.**
  378. #. Added a new ``ckeditor/fixups.js`` script which disables the version check
  379. *again* (if something slips through by accident) and which disables the
  380. behavior where CKEditor 4 would automatically attach itself to unrelated
  381. HTML elements with a ``contenteditable`` attribute (see
  382. ``CKEDITOR.disableAutoInline`` in the CKEditor 4 docs).
  383. 6.7.1
  384. -----
  385. #. Silenced the CKEditor version check and associated nag message in the
  386. frontend. Added a system check of our own which tells people to look for
  387. alternatives.
  388. 6.7.0
  389. -----
  390. #. CKEditor 4.22.1
  391. #. Dark mode fixes.
  392. #. Added support for Pillow 10.
  393. 6.6.0
  394. -----
  395. #. Required a newer version of django-js-asset which actually works with Django
  396. 4.1.
  397. #. CKEditor 4.21.0
  398. #. Fixed the CKEditor styles when used with the dark Django admin theme.
  399. 6.5.0
  400. -----
  401. #. Avoided calling ``static()`` if ``CKEDITOR_BASEPATH`` is defined.
  402. #. Fixed ``./manage.py generateckeditorthumbnails`` to work again after the
  403. image uploader backend rework.
  404. #. CKEditor 4.19.1
  405. #. Stopped calling ``static()`` during application startup.
  406. #. Added Django 4.1
  407. 6.4.0
  408. -----
  409. #. Changed the context for the widget to deviate less from Django. Removed a
  410. few template variables which are not used in the bundled
  411. ``ckeditor/widget.html`` template. This only affects you if you are using a
  412. customized widget or widget template.
  413. #. Dropped support for Python < 3.8, Django < 3.2.
  414. #. Added a pre-commit configuration.
  415. #. Removed the Travis CI configuration; Travis CI hasn't run our unit tests for
  416. months now.
  417. #. Added a GitHub action for running tests.
  418. #. Made selenium tests require opt in using a ``SELENIUM=firefox`` or
  419. ``SELENIUM=chromium`` environment variable.
  420. 6.3.0
  421. -----
  422. #. CKEditor 4.18.0
  423. #. Made it possible to override the CKEditor template in the widget class.
  424. #. Changed ``CKEDITOR_IMAGE_BACKEND`` to require dotted module paths (the old
  425. identifiers are still supported for now).
  426. 6.2.0
  427. -----
  428. #. CKEditor 4.17.1
  429. 6.1.0
  430. -----
  431. #. CKEditor 4.16.1
  432. 6.0.0
  433. -----
  434. #. Replace ``ugettext_lazy()`` with ``gettext_lazy()``
  435. #. CKEditor 4.14.1
  436. #. Changed our JS script to listen for Django's ``formset:added``
  437. signals instead of detecting clicks on inline buttons. This should
  438. fix compatibility with various Django admin skins.
  439. #. Dropped compatibility guarantees for Django<2.2 and Python<3.6.
  440. #. Reformatted the code using black, isort.
  441. #. Added testing using Django 3.1.
  442. 5.9.0
  443. -----
  444. #. Django 3.0 support
  445. #. Python 3.8 support
  446. #. Replace `staticfiles` templatetags library usage with `static`
  447. #. Add a templates validation step to the tests
  448. #. Internationalize ckeditor_upload `browse.html` template.
  449. #. Add ckeditor_upload features and custom configuration example to
  450. `ckeditor_demo`
  451. #. CKEditor 4.13.1
  452. 5.8.0
  453. -----
  454. #. CKEditor 4.13
  455. 5.7.1
  456. -----
  457. #. CKEditor 4.11.4
  458. #. Fix JS handling again
  459. #. Allow using settings to configure ``extra_plugins`` and
  460. ``external_plugin_resources``
  461. 5.7.0
  462. -----
  463. #. Fix Django 1.8 - 1.10 regression
  464. #. Drop leftover support for Django older than 1.8
  465. #. Django 2.2 support
  466. #. Documentation updates
  467. #. Minor fixes to JS handling
  468. 5.6.1
  469. -----
  470. #. Fix bad pypi package
  471. 5.6.0
  472. -----
  473. #. Django 2.1 compatibility, minimal supported Django version is 1.11 LTS
  474. #. Option to set custom django file backend for CKEditor uploader app.
  475. 5.5.0
  476. -----
  477. #. CKEditor 4.9.2
  478. #. Documentation improvements
  479. #. Allow non-string properties of user for CKEDITOR_RESTRICT_BY_USER
  480. 5.4.0
  481. -----
  482. #. Django 2.0 compatibility
  483. 5.3.1
  484. -----
  485. #. Actually include the code which sets ``CKEDITOR_BASEPATH``.
  486. #. CKEditor 4.7.3
  487. 5.3.0
  488. -----
  489. #. CKEditor 4.7
  490. #. Fix storage problems by setting ``CKEDITOR_BASEPATH`` (hopefully for real
  491. this time)
  492. #. Documentation updates
  493. #. Added a ``CKEDITOR_RESTRICT_BY_DATE`` setting to add uploaded files into
  494. folders containing the current date.
  495. #. Added a ``CKEDITOR_FILEICONS`` setting that allows overriding the
  496. icons used by Gallerific.
  497. #. Added a ``CKEDITOR_FILENAME_GENERATOR`` setting which allows
  498. specifying a callable which mangles the filename of uploaded files.
  499. #. Added ``THUMBNAIL_SIZE`` and ``IMAGE_QUALITY`` settings for the
  500. Pillow image backend.
  501. #. Actually include static assets for ``ckeditor_uploader`` in the
  502. pip-installable package.
  503. #. Removed ``CKEDITOR_JQUERY_URL`` and the jQuery dependency. The
  504. CKEditor activation now uses plain JavaScript. Dependencies are
  505. `JSON.parse <http://caniuse.com/#search=json.parse>`__ and
  506. `document.querySelectorAll <http://caniuse.com/#search=querySelectorAll>`__
  507. which are supported in practically all used browsers these days.
  508. #. Fixed a bug where the CKEditor language was not set individually for
  509. each request.
  510. 5.2.2
  511. -----
  512. #. Django 1.11 support
  513. #. Drop South migrations
  514. #. Fix storage problems by setting CKEDITOR_BASEPATH
  515. 5.2.1
  516. -----
  517. #. Fix CKEditor package static path
  518. 5.2.0
  519. -----
  520. #. Django 1.10 updates
  521. #. Development dependencies bump
  522. #. CKEditor 4.6.1
  523. #. Paste image support
  524. #. Fix for ManifestStaticFilesStorage
  525. 5.1.1
  526. -----
  527. #. Re-add missing additional CkEditor plugins
  528. 5.1.0
  529. -----
  530. #. Updated CkEditor to 4.5.10
  531. #. Django 1.10 compatibility changes
  532. #. Documentation updates
  533. 5.0.3
  534. -----
  535. #. Fix file/directory browsing and searching
  536. #. Editor width style fixes
  537. #. Added CKEDITOR_BROWSE_SHOW_DIRS
  538. #. Added CKEDITOR_ALLOW_NONIMAGE_FILES
  539. #. Python 2.6 compatibility fix
  540. 5.0.2
  541. -----
  542. #. Added template missing in the package
  543. 5.0.1
  544. -----
  545. #. Update Readme with backward-incompatible changes
  546. 5.0.0 (4.5.3)
  547. -------------
  548. #. Moved file upload code to new Django application - ckeditor_uploader. `RichTextField` doesn't use file upload which have been moved to `RichTextUploadingField`.
  549. 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.
  550. #. Updated ckeditor to 4.5.3 (from https://github.com/ckeditor/ckeditor-dev/tree/4.5.3)
  551. #. 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
  552. #. Add `zip_safe=False` on setup config, to force does not create ".egg" file
  553. #. Add python Wheel package configuration
  554. #. 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`` )
  555. #. Improved Tox configuration to code coverage check, code quality check (flake8), imports order check (isort) and test with django master branch
  556. #. Add code quality configurations
  557. #. Add EditorConfig configuration file
  558. #. Refactored code to be in compliance with PEP8
  559. 4.5.1
  560. -----
  561. #. Fixed unbound variable in non-image file upload
  562. 4.5.0
  563. -----
  564. #. Updated ckeditor to 4.5.1
  565. #. Reverted django.contrib.staticfiles.templatetags.staticfiles.static usage causing problems with some storages
  566. #. Allow non-image files to be upload (the upload widget expects images so the user experience isn't best at the moment)
  567. #. Few refactors and fixes to selenium tests
  568. 4.4.8
  569. -----
  570. #. Python 3 compatibility fixes
  571. #. Get static files paths in a proper way
  572. #. Fix Django 1.7 deprecation warning
  573. #. More examples in readme
  574. 4.4.7
  575. -----
  576. #. Allow only POST requests on upload view.
  577. #. Exclude hidden files from image browser
  578. #. Prevent caching of image browser view
  579. #. Use lazy JSON encoder to support i18n in CKEditor settings.
  580. #. Misc documentation updates
  581. #. Check for jQuery presence correctly
  582. #. Update to CKEditor 4.4.6
  583. 4.4.6
  584. -----
  585. #. Make upload/browse views be staff_member_required by default (can be overridden)
  586. #. Fix ckeditor initialisation code breaking with other jQuery versions.
  587. #. Support grappelli inline form widgets.
  588. #. Remove odd left margin from widget template.
  589. #. Allow running selenium tests with chromium.
  590. 4.4.5
  591. -----
  592. #. Post merge package name fix in Readme
  593. 4.4.4
  594. -----
  595. #. Update CKEditor to 4.4.4 full package - for all plugins and static files you may need
  596. #. Fixes for inline editor
  597. #. Editor initialisation uses jQuery. You need to specify CKEDITOR_JQUERY_URL for it to work. You can use::
  598. CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
  599. 4.4.0
  600. -----
  601. #. Update CKEditor to 4.4.1
  602. #. Django 1.7 compatibility fix
  603. 4.2.8
  604. -----
  605. #. Update CKEditor to 4.3.3
  606. 4.2.7
  607. -----
  608. #. Fix slugifying to empty filename if only bad characters given in filename. Use random string as fallback.
  609. #. Don't use IMG tags for non image files in ckeditor file browser.
  610. #. Remove non-existing image reference from CSS files that broke collectstatic.
  611. #. Misc fixes
  612. 4.2.5 / 4.2.6
  613. -------------
  614. #. Fix static files installation - switch from distutils to setuptools
  615. 4.2.4
  616. -----
  617. #. Added new demo application with selenium integration test
  618. #. tox setup for Python 3.3 and 2.7 testing
  619. #. Extracted image processing to backends. PIL/Pillow is optional now. Other backends can be added.
  620. #. Fixed a bug with thumbnail generation
  621. 4.2.3
  622. -----
  623. #. Python 3.3 compatibility
  624. #. All uploaded files are slugified by default (New settings CKEDITOR_SLUGIFY_FILENAME)
  625. #. Upload file when editing a link (<a href>) now works properly
  626. 4.2.2
  627. -----
  628. #. Python 3.3 compatibility in widgets.py
  629. 4.2.1
  630. -----
  631. #. Include CKEditor version 4.2.1.
  632. #. Support Django 1.6
  633. 4.0.2
  634. -----
  635. #. Include CKEditor version 4.0.2.
  636. 3.6.2.1
  637. -------
  638. #. Remove unwanted static files from distribution.
  639. #. Use Pillow instead of PIL since it builds on all systems.
  640. 3.6.2
  641. -----
  642. #. Include CKEditor version 3.6.2.
  643. #. Initial work on Django aligned theme.
  644. #. Fix schema slash removal issue on media url generation. Thanks `mwcz <https://github.com/mwcz>`__
  645. #. Added compatibility for South. Thanks `3point2 <https://github.com/3point2>`__
  646. #. Prevented settings from leaking between widget instances. Thanks `3point2 <https://github.com/3point2>`__
  647. #. Fixed config_name conflict when verbose_name is used as first positional argument for a field. Thanks `3point2 <https://github.com/3point2>`__
  648. #. Refactored views to allow use of file walking with local paths. Thanks `3point2 <https://github.com/3point2>`__
  649. #. Added command to generate thumbnails. Thanks `3point2 <https://github.com/3point2>`__
  650. #. Migrated from using media to static file management.
  651. 0.0.9
  652. -----
  653. #. Added ability to configure CKeditor through a CKEDITOR_CONFIGS settings. Thanks `jeffh <https://github.com/jeffh>`__ for the input.
  654. 0.0.8
  655. -----
  656. #. Removed buggy url include check.
  657. 0.0.7
  658. -----
  659. #. Egg package corrected to exclude testing admin.py and models.py.
  660. 0.0.6
  661. -----
  662. #. Enforce correct configuration.
  663. #. Changed upload behavior to separate files into directories by upload date. Thanks `loop0 <http://github.com/loop0>`__ .
  664. #. Added ability to limit user access to uploaded content (see the CKEDITOR_RESTRICT_BY_USER setting). Thanks `chr15m <http://github.com/chr15m>`__ for the input.
  665. #. Added initial set of much needed tests.
  666. #. General cleanup, light refactor.
  667. 0.0.5
  668. -----
  669. #. csrf_exempt backwards compatability. Thanks `chr15m <http://github.com/chr15m>`__ .
  670. 0.0.4
  671. -----
  672. #. Include resources, sorry about that.
  673. 0.0.3
  674. -----
  675. #. More robust PIL import. Thanks `buchuki <http://github.com/buchuki>`__ .
  676. #. Better CKEDITOR_MEDIA_PREFIX setting error.
  677. 0.0.2
  678. -----
  679. #. Included README.rst in manifest.
  680. 0.0.1
  681. -----
  682. #. Added CKEDITOR_UPLOAD_PREFIX setting. Thanks `chr15m <http://github.com/chr15m>`__ for the input.