A custom Django WYSIWYG editor widget.
Project description
Unchained Editor
A custom Django WYSIWYG editor widget.
Licensed under the GNU General Public License v3.0 (GPLv3).
Features
- Rich Text Editing: Style text (bold, italic, etc.), insert images, videos, tables, and more.
- Django Integration: A drop-in replacement for Django’s
TextField
orCharField
in models and forms. - Toolbar Customization: Easily configure buttons for formatting, lists, links, alignment, images, etc.
- CSS/JS Customization: Ships with default
styles.css
andscript.js
—override or expand them as needed.
Installation
- Install via PyPI:
pip install unchained-editor
- Add to settings.py
INSTALLED_APPS = [
# ...
'unchained_editor',
# ...
]
UNCHAINED_EDITOR_LICENSE_KEY = "your license key (get from the author)"
- Add to urls.py in the main project
urlpatterns = [
# ...
path('unchained_editor/', include('unchained_editor.urls', namespace='unchained_editor')),
# ...
]
- Collectstatic to load WYSIWYG styles
python manage.py collectstatic
Usage
A. Model Field
# myapp/models.py
from django.db import models
from unchained_editor.fields import CustomWYSIWYGField
class Post(models.Model):
title = models.CharField(max_length=200)
content = CustomWYSIWYGField()
# ...
In Django Admin or any ModelForm, content will now render as a rich text editor.
B. Form Field
# myapp/forms.py
from django import forms
from unchained_editor.widgets import CustomWYSIWYGWidget
class PostForm(forms.Form):
title = forms.CharField(max_length=200)
content = forms.CharField(widget=CustomWYSIWYGWidget())
License
Unchained Editor is released under the GNU General Public License v3.0 (GPLv3).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
unchained_editor-0.1.0.tar.gz
(23.3 kB
view details)
Built Distribution
File details
Details for the file unchained_editor-0.1.0.tar.gz
.
File metadata
- Download URL: unchained_editor-0.1.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.4 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c905b4faff7aeb120c299278f2b104864788ac7d9676be19254a7399afae0214
|
|
MD5 |
df9fa8e89b6a82d232dda18fa958a74d
|
|
BLAKE2b-256 |
d4a3d4f225afba65850343662aa5ebe56266bf2cb9ebb564a5caf0b185d6ed6f
|
File details
Details for the file unchained_editor-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: unchained_editor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.4 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
128ddec0aa56aff6f369a87fd8872b85663141d63d74f4dca2285e2cd21dbd19
|
|
MD5 |
01a789bbe59923ff9cae436622f84f45
|
|
BLAKE2b-256 |
1109fb43e01274e5dfb565cf6735217205f60cde48458bae7606324b5f4f8366
|