
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
A django form widget for CLEditor (a super clean, MIT licensed WYSIWYG HTML editor) that handles uploading
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
django-ckeditor |
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
A simple django app that makes using an WYSIWYG editor (CLEditor) extremely easy. Optionally includes a mixin that activates file upload handling.
Download and add django-cleditor
to your packages however you wish.
pip install django-cleditor
cleditor
to your INSTALLED_APPS
python manage.py collectstatic
management command to ... collect the static files.cleditor.widgets.CLEditorWidget
anywhere a django form widget is expected.cleditor.admin.CLEditorUploadAdmin
and use cleditor.widgets.CLEditorUploadWidget
instead.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:
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!
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
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()}}
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.
# urls.py
from cleditor.admin import cleditor_upload_handler
urlpatterns = patterns('',
(r'^my-upload-handler/$', cleditor_upload_handler, {'upload_to': 'my_upload_directory'}),
)
# widget instantiation
class MyForm(forms.Form):
myfield = forms.TextField(widget=CLEditorUploadAdmin(upload_url='path-to-my-upload-handler'))
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/
FAQs
A django form widget for CLEditor (a super clean, MIT licensed WYSIWYG HTML editor) that handles uploading
We found that django-cleditor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.