Integrate Quill editor with Django project.
Project description
django-quill-editor
django-quill-editor makes Quill.js easy to use on Django Forms and admin sites
- No configuration required for static files!
- The entire code for inserting WYSIWYG editor is less than 30 lines
- It can be used in both admin and Django views
Live Demo
https://quill.lhy.kr/
- Form | https://quill.lhy.kr/posts/create/normal/
- ModelForm | https://quill.lhy.kr/posts/create/
- Form (Initial HTML) | https://quill.lhy.kr/posts/create/normal/html/
- Form (Initial Text) | https://quill.lhy.kr/posts/create/normal/text/
- Admin | https://quill.lhy.kr/admin/login/
Documentation
The full document is in https://django-quill-editor.readthedocs.io/, including everything about how to use the Form or ModelForm, and where you can add custom settings.
Please refer to the QuickStart section below for simple usage.
QuickStart
Setup
-
Install
django-quill-editor
to your Python environmentRequires Python 3.7 or higher and Django 3.1 or higher.
pip install django-quill-editor
-
Add
django_quill
toINSTALLED_APPS
insettings.py
# settings.py INSTALLED_APPS = [ 'django.contrib.admin', ... 'django_quill', ]
Making Model
Add QuillField
to the Model class you want to use.
- App containing models.py must be added to INSTALLED_APPS
- After adding the app, you need to run makemigrations and migrate to create the DB table.
# models.py from django.db import models from django_quill.fields import QuillField class QuillPost(models.Model): content = QuillField()
Using in admin
Just register the Model in admin.py of the app.
from django.contrib import admin from .models import QuillPost @admin.register(QuillPost) class QuillPostAdmin(admin.ModelAdmin): pass
Running the Live Demo project in local
The live demo is a deployment of the "playground" package, which is a django application within this library.
After cloning or downloading the repository, you can try running the live demo locally.
A Python virtual environment is required to run the project.
# [Optional] We recommend that you start after creating a folder for your project. mkdir ~/projects cd projects # Clone repository git clone git@github.com:LeeHanYeong/django-quill-editor.git # Go to the project directory and apply the virtual environment cd django-quill-editor # [apply venv] # Go to the playground package cd playground # Install requirements pip install -r requirements.txt # Run migrate and runserver python manage.py migrate python manage.py runserver
After the above operation, the live demo site works at localhost:8000.
Contributing
As an open source project, we welcome contributions. The code lives on GitHub
Distribution tips (for owners)
Installation
# black brew install black # pre-commit brew install pre-commit pre-commit install
PyPI Release
poetry install # Install PyPI distribution packages
python deploy.py
Sphinx docs
brew install sphinx-doc # macOS
Local
cd docs
make html
# ...
# The HTML pages are in _build/html.
cd _build/html
python -m http.server 3001
docker-compose up (in local)
docker-compose -f docker-compose-local.yml up --build --force-recreate --remove-orphans
Project details
Release history Release notifications | RSS feed
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
Hashes for django-quill-editor-0.1.27.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 170bcc6274adae7b2a3a57b3608c76f2d883c5ac05b4783619ef1a27601c8970 |
|
MD5 | 9a38773db272df85a220179ef96a2e3c |
|
BLAKE2-256 | 11ed81e65fcb9aaa86c813a7ef07a6218d52749bda5cff1719293a93595da24b |
Hashes for django_quill_editor-0.1.27-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e307fa20928642937f894379db6efaf043ce8bffd6cb6dd9e1bef889d46fa6c |
|
MD5 | 8ad2a9289173ec2884165fe8cc26e380 |
|
BLAKE2-256 | 67b0874241730b808a765f5db6dad80bebba5073d124ed193510983f95e22c73 |