Skip to content

Commit 424fe98

Browse files
committed
Rename package
1 parent 002e2d5 commit 424fe98

File tree

15 files changed

+30
-30
lines changed

15 files changed

+30
-30
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Django plugin for using [Editor.js](https://editorjs.io/)
77
## Installation
88

99
```bash
10-
pip install django-editorjs
10+
pip install django-editorjs-fields
1111
```
1212

13-
Add django_editorjs to INSTALLED_APPS in settings.py for your project:
13+
Add django_editorjs_fields to INSTALLED_APPS in settings.py for your project:
1414
```python
1515
# settings.py
1616
INSTALLED_APPS = [
1717
...
18-
'django_editorjs',
18+
'django_editorjs_fields',
1919
]
2020
```
2121

@@ -25,7 +25,7 @@ Add code in your model
2525
```python
2626
# models.py
2727
from django.db import models
28-
from django_editorjs import EditorJsJSONField, EditorJsTextField # import
28+
from django_editorjs_fields import EditorJsJSONField, EditorJsTextField # import
2929

3030

3131
class Post(models.Model):
@@ -40,7 +40,7 @@ Or add custom Editor.js plugins and configs ([List plugins](https://github.com/e
4040
```python
4141
# models.py
4242
from django.db import models
43-
from django_editorjs import EditorJsJSONField, EditorJsTextField # import
43+
from django_editorjs_fields import EditorJsJSONField, EditorJsTextField # import
4444

4545

4646
class Post(models.Model):
@@ -70,7 +70,7 @@ class Post(models.Model):
7070

7171
```
7272

73-
If you want to upload images to the editor then add django_editorjs.urls to urls.py for your project:
73+
If you want to upload images to the editor then add django_editorjs_fields.urls to urls.py for your project:
7474
```python
7575
# urls.py
7676
from django.contrib import admin
@@ -80,13 +80,13 @@ from django.conf.urls.static import static
8080

8181
urlpatterns = [
8282
path('admin/', admin.site.urls),
83-
path('editorjs/', include('django_editorjs.urls')),
83+
path('editorjs/', include('django_editorjs_fields.urls')),
8484
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
8585
```
8686

87-
See an example of how you can work with the plugin [here](https://github.com/2ik/django-editorjs/blob/main/example)
87+
See an example of how you can work with the plugin [here](https://github.com/2ik/django-editorjs-fields/blob/main/example)
8888

8989

9090
## Support and updates
9191

92-
Use github issues https://github.com/2ik/django-editorjs/issues
92+
Use github issues https://github.com/2ik/django-editorjs-fields/issues
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
from django.db.models import Field
33
from django.forms import Textarea
44

5-
from django_editorjs.widgets import EditorJsWidget
6-
75
from .config import DEBUG
6+
from .widgets import EditorJsWidget
87

98
try:
109
# pylint: disable=ungrouped-imports
@@ -45,11 +44,13 @@ def formfield(self, **kwargs):
4544

4645

4746
class EditorJsTextField(EditorJsFieldMixin, FieldMixin):
47+
# pylint: disable=useless-super-delegation
4848
def __init__(self, plugins=None, tools=None, **kwargs):
4949
super().__init__(plugins, tools, **kwargs)
5050

5151

5252
class EditorJsJSONField(EditorJsFieldMixin, JSONField if HAS_JSONFIELD else FieldMixin):
53+
# pylint: disable=useless-super-delegation
5354
def __init__(self, plugins=None, tools=None, **kwargs):
5455
super().__init__(plugins, tools, **kwargs)
5556

django_editorjs/static/admin/2ik/django-editorjs/css/django-editorjs.css renamed to django_editorjs_fields/static/django-editorjs-fields/css/django-editorjs-fields.css

File renamed without changes.

django_editorjs/static/admin/2ik/django-editorjs/js/django-editorjs.js renamed to django_editorjs_fields/static/django-editorjs-fields/js/django-editorjs-fields.js

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.contrib.admin.views.decorators import staff_member_required
22
from django.urls import path
33

4-
from django_editorjs.views import ImageUploadView
4+
from .views import ImageUploadView
55

66
urlpatterns = [
77
path('image_upload/', staff_member_required(ImageUploadView.as_view()),
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
from django.views import View
66
from django.views.decorators.csrf import csrf_exempt
77

8-
from django_editorjs.config import (EDITORJS_IMAGE_NAME,
9-
EDITORJS_IMAGE_NAME_ORIGINAL,
10-
EDITORJS_IMAGE_NAME_POSTFIX,
11-
EDITORJS_IMAGE_UPLOAD_PATH)
12-
from django_editorjs.utils import storage
8+
from .config import (EDITORJS_IMAGE_NAME, EDITORJS_IMAGE_NAME_ORIGINAL,
9+
EDITORJS_IMAGE_NAME_POSTFIX, EDITORJS_IMAGE_UPLOAD_PATH)
10+
from .utils import storage
1311

1412

1513
class ImageUploadView(View):
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def media(self):
4242
js_list.append('https://cdn.jsdelivr.net/combine/npm/' +
4343
',npm/'.join(plugins))
4444

45-
js_list.append('admin/2ik/django-editorjs/js/django-editorjs.js')
45+
js_list.append('django-editorjs-fields/js/django-editorjs-fields.js')
4646

4747
return Media(
48-
css={'all': ['admin/2ik/django-editorjs/css/django-editorjs.css']},
48+
css={
49+
'all': ['django-editorjs-fields/css/django-editorjs-fields.css']},
4950
js=js_list
5051
)
5152

0 commit comments

Comments
 (0)