Skip to content

Commit ef1b51f

Browse files
committed
Update Readme
1 parent eabcbe8 commit ef1b51f

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ class Post(models.Model):
5757
<title>Document</title>
5858
</head>
5959
<body>
60-
{% load editorjs %}
61-
{{ post.body_default }}
62-
{{ post.body_editorjs | editorjs}}
63-
{{ post.body_editorjs_text | editorjs}}
60+
{% load editorjs %} {{ post.body_default }} {{ post.body_editorjs |
61+
editorjs}} {{ post.body_editorjs_text | editorjs}}
6462
</body>
6563
</html>
6664
```
@@ -275,17 +273,17 @@ plugin use css property [prefers-color-scheme](https://developer.mozilla.org/en-
275273
The application can be configured by editing the project's `settings.py`
276274
file.
277275

278-
| Key | Description | Default |
279-
| ------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------- |
280-
| `EDITORJS_DEFAULT_PLUGINS` | List of plugins names Editor.js from npm | [See above](#plugins) |
281-
| `EDITORJS_DEFAULT_CONFIG_TOOLS` | Map of Tools to use | [See above](#plugins) |
282-
| `EDITORJS_IMAGE_UPLOAD_PATH` | Path uploads images | `settings.MEDIA_URL + 'uploads/images/'` |
283-
| `EDITORJS_IMAGE_NAME_ORIGINAL` | To use the original name of the image file? | `False` |
284-
| `EDITORJS_IMAGE_NAME_POSTFIX` | Image file name postfix. Ignored when `EDITORJS_IMAGE_NAME_ORIGINAL` is `True` | `token_urlsafe(5)` |
285-
| `EDITORJS_IMAGE_NAME` | Image file name postfix. Ignored when `EDITORJS_IMAGE_NAME_ORIGINAL` is `False` | `token_urlsafe(8)` |
286-
| `EDITORJS_VERSION` | Version Editor.js | `2.22.1` |
287-
288-
For `EDITORJS_IMAGE_NAME_POSTFIX` and `EDITORJS_IMAGE_NAME` was used `from secrets import token_urlsafe`
276+
| Key | Description | Default | Type |
277+
| --------------------------------- | ---------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
278+
| `EDITORJS_DEFAULT_PLUGINS` | List of plugins names Editor.js from npm | [See above](#plugins) | `list[str]`, `tuple[str]` |
279+
| `EDITORJS_DEFAULT_CONFIG_TOOLS` | Map of Tools to use | [See above](#plugins) | `dict[str, dict]` |
280+
| `EDITORJS_IMAGE_UPLOAD_PATH` | Path uploads images | `uploads/images/` | `str` |
281+
| `EDITORJS_IMAGE_UPLOAD_PATH_DATE` | Subdirectories | `%Y/%m/` | `str` |
282+
| `EDITORJS_IMAGE_NAME_ORIGINAL` | To use the original name of the image file? | `False` | `bool` |
283+
| `EDITORJS_IMAGE_NAME` | Image file name. Ignored when `EDITORJS_IMAGE_NAME_ORIGINAL` is `True` | `token_urlsafe(8)` | `callable(filename: str, file: django.core.files.uploadedfile.InMemoryUploadedFile)` ([docs](https://docs.djangoproject.com/en/3.0/ref/files/uploads/)) |
284+
| `EDITORJS_VERSION` | Version Editor.js | `2.22.2` | `str` |
285+
286+
For `EDITORJS_IMAGE_NAME` was used `from secrets import token_urlsafe`
289287

290288
## Support and updates
291289

example/example/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,6 @@
139139

140140
# django_editorjs_fields
141141
EDITORJS_VERSION = '2.22.1'
142+
# EDITORJS_IMAGE_NAME_ORIGINAL = True
143+
# EDITORJS_IMAGE_UPLOAD_PATH_DATE = None
144+
# EDITORJS_IMAGE_NAME = lambda filename, **_: f"{filename}_12345"

0 commit comments

Comments
 (0)