Rich web editor widgets in the Django Admin
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-editor-widgets-2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a9ceeaa500dea06da5985cc4135b02de592c9c1bc2bae3306e845aba3e078c |
|
MD5 | 6d92d0aba7462eb69e7cecf0bc315550 |
|
BLAKE2b-256 | c4155c6c25c80af88297a49fd4434866992b31f376b7d3106df1c9b286f341a2 |
Close
Hashes for django_editor_widgets-2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d601dbb40eb5fc901b6f7d5daff467b3b164fbb7223f4980d18f9dcd5cf5ef79 |
|
MD5 | 70fd50e9af7dcb45c65f08b3800c2d9d |
|
BLAKE2b-256 | 65e540b18aefb5a65d47262a274070ff1baa6e1b7d423965492e41df161d6764 |