|
3 | 3 |
|
4 | 4 | from django.conf import settings |
5 | 5 |
|
6 | | - |
7 | 6 | DEBUG = getattr(settings, "DEBUG", False) |
8 | 7 |
|
9 | | -EDITORJS_IMAGE_UPLOAD_PATH = str(getattr( |
10 | | - settings, |
11 | | - 'EDITORJS_IMAGE_UPLOAD_PATH', |
12 | | - 'uploads/images/' |
13 | | -)) + datetime.now().strftime("%Y/%m/") |
| 8 | +EDITORJS_IMAGE_UPLOAD_PATH = str( |
| 9 | + getattr(settings, 'EDITORJS_IMAGE_UPLOAD_PATH', 'uploads/images/') |
| 10 | +) + datetime.now().strftime("%Y/%m/") |
14 | 11 |
|
15 | | -EDITORJS_IMAGE_NAME_ORIGINAL = getattr( |
16 | | - settings, "EDITORJS_IMAGE_NAME_ORIGINAL", False) |
| 12 | +EDITORJS_IMAGE_NAME_ORIGINAL = getattr(settings, "EDITORJS_IMAGE_NAME_ORIGINAL", False) |
17 | 13 | EDITORJS_IMAGE_NAME_POSTFIX = getattr( |
18 | | - settings, "EDITORJS_IMAGE_NAME_POSTFIX", token_urlsafe(5)) |
19 | | -EDITORJS_IMAGE_NAME = getattr( |
20 | | - settings, "EDITORJS_IMAGE_NAME", token_urlsafe(8)) |
| 14 | + settings, "EDITORJS_IMAGE_NAME_POSTFIX", token_urlsafe(5) |
| 15 | +) |
| 16 | +EDITORJS_IMAGE_NAME = getattr(settings, "EDITORJS_IMAGE_NAME", token_urlsafe(8)) |
21 | 17 |
|
22 | 18 | DEFAULT_PLUGINS = ( |
23 | 19 | '@editorjs/paragraph', |
|
34 | 30 | '@editorjs/warning', |
35 | 31 | '@editorjs/link', |
36 | 32 | '@editorjs/marker', |
37 | | - '@editorjs/table' |
| 33 | + '@editorjs/table', |
38 | 34 | ) |
39 | 35 |
|
40 | 36 | DEFAULT_CONFIG_PLUGINS = { |
41 | 37 | '@editorjs/image': { |
42 | 38 | 'Image': { |
43 | 39 | 'class': 'ImageTool', |
44 | 40 | 'inlineToolbar': True, |
45 | | - "config": { |
46 | | - "endpoints": { |
47 | | - "byFile": "/editorjs/image_upload/" |
48 | | - } |
49 | | - } |
| 41 | + "config": {"endpoints": {"byFile": "/editorjs/image_upload/"}}, |
50 | 42 | } |
51 | 43 | }, |
52 | 44 | '@editorjs/header': { |
|
56 | 48 | 'config': { |
57 | 49 | 'placeholder': 'Enter a header', |
58 | 50 | 'levels': [2, 3, 4], |
59 | | - 'defaultLevel': 2 |
60 | | - } |
61 | | - } |
62 | | - }, |
63 | | - '@editorjs/checklist': { |
64 | | - 'Checklist': { |
65 | | - 'class': 'Checklist', |
66 | | - 'inlineToolbar': True |
| 51 | + 'defaultLevel': 2, |
| 52 | + }, |
67 | 53 | } |
68 | 54 | }, |
69 | | - '@editorjs/list': { |
70 | | - 'List': { |
71 | | - 'class': 'List', |
72 | | - 'inlineToolbar': True |
73 | | - } |
74 | | - }, |
75 | | - '@editorjs/quote': { |
76 | | - 'Quote': { |
77 | | - 'class': 'Quote', |
78 | | - 'inlineToolbar': True |
79 | | - } |
80 | | - }, |
81 | | - '@editorjs/raw': { |
82 | | - 'Raw': { |
83 | | - 'class': 'RawTool' |
84 | | - } |
85 | | - }, |
86 | | - '@editorjs/code': { |
87 | | - 'Code': { |
88 | | - 'class': 'CodeTool' |
89 | | - } |
90 | | - }, |
91 | | - '@editorjs/inline-code': { |
92 | | - 'InlineCode': { |
93 | | - 'class': 'InlineCode' |
94 | | - } |
95 | | - }, |
96 | | - '@editorjs/embed': { |
97 | | - 'Embed': { |
98 | | - 'class': 'Embed' |
99 | | - } |
100 | | - }, |
101 | | - '@editorjs/delimiter': { |
102 | | - 'Delimiter': { |
103 | | - 'class': 'Delimiter' |
104 | | - } |
105 | | - }, |
106 | | - '@editorjs/warning': { |
107 | | - 'Warning': { |
108 | | - 'class': 'Warning', |
109 | | - 'inlineToolbar': True |
110 | | - } |
111 | | - }, |
112 | | - '@editorjs/link': { |
113 | | - 'LinkTool': { |
114 | | - 'class': 'LinkTool' |
115 | | - } |
116 | | - }, |
117 | | - '@editorjs/marker': { |
118 | | - 'Marker': { |
119 | | - 'class': 'Marker', |
120 | | - 'inlineToolbar': True |
121 | | - } |
122 | | - }, |
123 | | - '@editorjs/table': { |
124 | | - 'Table': { |
125 | | - 'class': 'Table', |
126 | | - 'inlineToolbar': True |
127 | | - } |
128 | | - } |
| 55 | + '@editorjs/checklist': {'Checklist': {'class': 'Checklist', 'inlineToolbar': True}}, |
| 56 | + '@editorjs/list': {'List': {'class': 'List', 'inlineToolbar': True}}, |
| 57 | + '@editorjs/quote': {'Quote': {'class': 'Quote', 'inlineToolbar': True}}, |
| 58 | + '@editorjs/raw': {'Raw': {'class': 'RawTool'}}, |
| 59 | + '@editorjs/code': {'Code': {'class': 'CodeTool'}}, |
| 60 | + '@editorjs/inline-code': {'InlineCode': {'class': 'InlineCode'}}, |
| 61 | + '@editorjs/embed': {'Embed': {'class': 'Embed'}}, |
| 62 | + '@editorjs/delimiter': {'Delimiter': {'class': 'Delimiter'}}, |
| 63 | + '@editorjs/warning': {'Warning': {'class': 'Warning', 'inlineToolbar': True}}, |
| 64 | + '@editorjs/link': {'LinkTool': {'class': 'LinkTool'}}, |
| 65 | + '@editorjs/marker': {'Marker': {'class': 'Marker', 'inlineToolbar': True}}, |
| 66 | + '@editorjs/table': {'Table': {'class': 'Table', 'inlineToolbar': True}}, |
129 | 67 | } |
0 commit comments