Skip to main content
# Django-editor-widgets


This package provides some custom widgets to use monaco or tinymce editors in django admin.


## Installation

To install the package by `pip` run following command

```sh
$ pip install git+https://github.com/giorgi94/django-editor-widgets.git
```

## Usage

To start using the package in your project, you need to open `settings.py` file and add following lines

```python
# settings.py
import os

# sets paths to static files for widgets
from djangoeditorwidgets.defaults import *


# Application definition

INSTALLED_APPS = [
...
'djangoeditorwidgets',
...
]

```

Now we can start using the widgets. To use tinymce we need to override widget in form
```python
# forms.py
from django import forms
from djangoeditorwidgets.widgets import TinymceWidget
from .models import TextModel


class TextModelForm(forms.ModelForm):

class Meta:
model = TextModel
fields = '__all__'
widgets = {
'text': TinymceWidget()
}
```

The package also provides custom fields, and widgets are already set for them.

```python
# models.py
from django.db import models
from djangoeditorwidgets.fields import XMLField, JsonField


class TextModel(models.Model):
title = models.CharField(max_length=50)
text = models.TextField()

def __str__(self):
return self.title


class XMLModel(models.Model):
title = models.CharField(max_length=50)
text = XMLField()

def __str__(self):
return self.title


class JSONModel(models.Model):
title = models.CharField(max_length=50)
text = JsonField()

def __str__(self):
return self.title

```
You don't need to use this fields and only change widgets in forms, but this fields provide simple validations.

Release files for django-editor-widgets 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-editor-widgets 1.0
File Size Uploaded
django-editor-widgets-1.0.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-editor-widgets 1.0
File Interpreter ABI Platform
django_editor_widgets-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.2 MB

Release files / django-editor-widgets-1.0.tar.gz

Download URL django-editor-widgets-1.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
bac7fcf5fb13abd250df2c7a1ffa5eb5ca3b194d92f62bacc3dd3fbde579a020
BLAKE2b-256 checksum
How to use checksums
36f3f783dc8d1355de0438b6cbb67f6aa298fd789914625f267152ae36e6b4c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.9.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

Release files / django_editor_widgets-1.0-py3-none-any.whl

Download URL django_editor_widgets-1.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
31fefb3c2cef269a261e11a5c84eb9ff422ff154f2eb26f71f143c59045b55c4
BLAKE2b-256 checksum
How to use checksums
f770e3313eac5920aae731622c97a7a06f92bb07698748d294af538163556dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.9.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

Release history Release notifications | RSS feed

4.2

2 release files

4.1

2 release files

4.0

2 release files

3.0

2 release files

2.0

2 release files

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page