django-editorjs
Plugin for using Editor.js in django admin.
Supported plugins/tools
@editorjs/paragraph-@editorjs/image-@editorjs/header-@editorjs/checklist-@editorjs/list-@editorjs/quote-@editorjs/raw-@editorjs/embed-@editorjs/delimiter-@editorjs/warning-@editorjs/link-@editorjs/marker-@editorjs/attaches-@editorjs/table-
⚠️ Note (for plugin configuration)
Usually in examples for Editor.js you will see tool names starts with lowercase, but for bypass potential conflicts i use uppercase.
Installation
pip install django-editorjs
Simple example
# models.py
from django.db import models
from django_editorjs import EditorJsField
class Post(models.Model):
title = models.CharField(max_length=255)
body = EditorJsField()
def __str__(self):
return self.title
How to configure
You can provide field specific configuration options to EditorJsField by argument editorjs_config.
Example
class Post(models.Model):
title = models.TextField()
body = EditorJsField(
editorjs_config={
"tools": {
"Table": {
"disabled": False,
"inlineToolbar": True,
"config": {"rows": 2, "cols": 3,},
}
}
}
)
Config schema
toolsImage- (dict) configuration for toolImageTool. (For more info see official documentation for tool).Header- (dict) configuration for toolHeader. (For more info see official documentation for tool).Checklist- (dict) configuration for toolChecklist. (For more info see official documentation for tool).List- (dict) configuration for toolList. (For more info see official documentation for tool).Quote- (dict) configuration for toolQuote. (For more info see official documentation for tool).Raw- (dict) configuration for toolRawTool. (For more info see official documentation for tool).Embed- (dict) configuration for toolEmbed. (For more info see official documentation for tool).Delimiter- (dict) configuration for toolDelimiter. (For more info see official documentation for tool).Warning- (dict) configuration for toolWarning. (For more info see official documentation for tool).Link- (dict) configuration for toolLinkTool. (For more info see official documentation for tool).Marker- (dict) configuration for toolMarker. (For more info see official documentation for tool).Attaches- (dict) configuration for toolAttachesTool. (For more info see official documentation for tool).Table- (dict) configuration for toolTable. (For more info see official documentation for tool).
API
-
EditorJsFieldExtends
TextFieldand useEditorJsWidgetas widget + have additional argument in constructor:editorjs_config. -
EditorJsWidgetWidget that you can to use for using Editor.js in Django.
TODO
- load tool on demand
- more examples in README.md
- view-function for file uploading
- view-function for image uploading
- view-function for link info crawler
Metadata
Release files for django-editorjs 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-editorjs-0.2.1.tar.gz | 5.3 kB | Without provenance | Details for django-editorjs-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_editorjs-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for django_editorjs-0.2.1-py3-none-any.whl |
Total release size: 11.1 kB
Release files / django-editorjs-0.2.1.tar.gz
| Download URL | django-editorjs-0.2.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
806faafdd6fffab10e174e21843c6df359ea4b6a849a73ba25de356daecd6a60
|
|
BLAKE2b-256 checksum How to use checksums |
fc08dc9dd5c95d524503a5167494d2a8cbbf55f374a996239d1e04ba2e738c01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.7.7 Darwin/18.7.0
|
Release files / django_editorjs-0.2.1-py3-none-any.whl
| Download URL | django_editorjs-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe01810d50c9d304799871c6f3d82c1bc8513e2dd13edb3eaef99e566069dc7c
|
|
BLAKE2b-256 checksum How to use checksums |
747d4b75a59f8ec95de2b801bf25e65811a5aa632c222173b45cc384def885cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.7.7 Darwin/18.7.0
|
Security for django-editorjs 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.