Skip to main content
What is it?
============

A simple django app that makes using an WYSIWYG editor (CLEditor) extremely easy.
Optionally includes a mixin that activates file upload handling.

![Screenshot](https://github.com/yuchant/django-cleditor/raw/master/cleditor.png)



Installation instructions
=========================

Download and add ``django-cleditor`` to your packages however you wish.

- The easiest method is to use pip: `pip install django-cleditor`
- Add ``cleditor`` to your ``INSTALLED_APPS``
- Run the ``python manage.py collectstatic`` management command to ... collect the static files.
- Use `cleditor.widgets.CLEditorWidget` anywhere a django form widget is expected.
- For admin upload handling subclass `cleditor.admin.CLEditorUploadAdmin` and use `cleditor.widgets.CLEditorUploadWidget` instead.



Usage instructions
==================


Editor only
-----------

This package supplies a ``CLEditorWidget`` form widget in ``cleditor.widgets`` that you can use anywhere the django forms framework expects a widget.

To replace all textfields in a ``ModelAdmin`` with ``CLEditors`` simply paste two lines:

```python
from django.db import models
from cleditor.widgets import CLEditorWidget

class MyModelAdmin(admin.ModelAdmin):
formfield_overrides = { models.TextField: {'widget': CLEditorWidget()}}
```

_Note: If you need finer control over which textfields get overriden, look into ``ModelAdmin.formfield_for_dbfield``_

You're done!


Easy admin upload handler
-------------------------

To allow users to upload via a the insert image widget, you must use the `CLEditorUploadWidget` widget and you must subclass the included `ModelAdmin` which adds a fully csrf protected upload handler to your admin site.

You can specify a new upload directory by adding an `upload_to` attribute to the `ModelAdmin`

```python
from django.db import models
from cleditor.widgets import CLEditorUploadWidget
from cleditor.admin import CLEditorUploadAdmin

class MyModelAdmin(CLEditorUploadAdmin):
# upload_to = 'cleditorupload/' # default
formfield_overrides = { models.TextField: {'widget': CLEditorUploadWidget()}}
```


Stand alone uploader (non admin)
--------------------------------

To upload images without the admin panel, you'll have to map a URL to the upload handler and pass in your custom handler URL to the widget.


```python
# urls.py

from cleditor.admin import cleditor_upload_handler

urlpatterns = patterns('',
(r'^my-upload-handler/$', cleditor_upload_handler, {'upload_to': 'my_upload_directory'}),
)
```


```python
# widget instantiation

class MyForm(forms.Form):
myfield = forms.TextField(widget=CLEditorUploadAdmin(upload_url='path-to-my-upload-handler'))
```


Credits
========
* Chris Landowski - original cleditor image upload plugin
https://github.com/dmitry-dedukhin/cleditor-extimage-plugin

* Dmitry Dedukhim - cleditor jquery plugin creator
http://premiumsoftware.net/cleditor/

Metadata

Release files for django-cleditor 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cleditor 0.2.1
File Size Uploaded Provenance Actions
django-cleditor-0.2.1.tar.gz 1.3 MB Without provenance Details for django-cleditor-0.2.1.tar.gz

Release files / django-cleditor-0.2.1.tar.gz

Download URL django-cleditor-0.2.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
bad9de6c3f627ea7c3d89622cf1af6651f272b79f21b25a4eb191d441e534e4b
BLAKE2b-256 checksum
How to use checksums
833af67befaf231a3f4da2a930cf4ecc824c8fa7d0e6c7616231eee2247b521d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-cleditor 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page