Django admin KindEditor integration.
Project description
django-kindeditor
This repo is to make it easy to use KindEditor as a RichTextEditor when using django.
You can visit this site to see the editor result: http://kindeditor.org/
Requires
- Django 2.0+
- Python 3.6+
Use
- Install
pip install django-kindeditor
- Add
kindeditor
andrest_framework
to INSTALL_APPS in settings
INSTALLED_APPS = [
...
'kindeditor',
'rest_framework',
]
Example
# models.py
from kindeditor import RichTextField
class Article(models.Model):
title = models.CharField(max_length=80)
content = RichTextField()
# settings.py
KINDEDITOR_UPLOAD_PERMISSION = 'admin'
# admin.py
from django.contrib import admin
from kindeditor import EditorAdmin
from .models import Article
admin.site.register(Article, EditorAdmin)
Demo
- clone the repo to local
git clone https://github.com/waketzheng/django-kindeditor
- create a virtual environment and install required packages
pipenv install --dev
- activate it
pipenv shell
- migrate and compile translation file
./manage.py migrate
./manage.py compilemessages
- runserver
./manage.py runserver
- view the url and you will see the demo at webbrowser
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
django-kindeditor-0.0.4.tar.gz
(515.8 kB
view hashes)
Built Distribution
Close
Hashes for django_kindeditor-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417beeca771c92781f0cfac838b9c2dc874b0434eec73102d5cc7b4ce814a05b |
|
MD5 | e60b56c716cf7efe58ae95b89788b979 |
|
BLAKE2b-256 | 9bb2ddf193cec48769f20111b1cc2b601fc329d3109a9f7c8b90251c5f7ae4d1 |