Skip to content

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

Notifications You must be signed in to change notification settings

sdementen/django-editor-widgets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

# From Github (latest updates)
$ pip install git+https://github.com/giorgi94/django-editor-widgets.git
# Or
$ pip install django-editor-widgets

Usage

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

# settings.py
import os

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


# Application definition

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

Now we can start using the widgets. To use tinymce we need to change widget in form

# 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 field, and widget are already set for them.

# models.py
from django.db import models
from djangoeditorwidgets.fields import XMLField



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

    def __str__(self):
        return self.title

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.8%
  • Python 4.9%
  • CSS 0.3%