Skip to main content

Django-AiEditor 是一个为 Django 框架提供的 AiEditor 富文本编辑器集成包。

Project description

Django-AiEditor

Django-AiEditor 是一个为 Django 框架提供的 AiEditor 富文本编辑器集成包。AiEditor 是一个强大的 Web 富文本编辑器。

安装

pip install django-aieditor

快速开始

  1. 将 'django_aieditor' 添加到你的 INSTALLED_APPS 中:
INSTALLED_APPS = [
    ...
    'django_aieditor',
]
  1. 配置上传URL路由,在项目的urls.py中添加:
from django.urls import path, include

urlpatterns = [
    ...
    path('aieditor/', include('django_aieditor.urls')),
]
  1. 在你的模型中使用:
from django_aieditor.fields import AiEditorModelField

class MyModel(models.Model):
    content = AiEditorModelField("内容")
  1. 在你的表单中使用:
from django_aieditor.fields import AiEditorField

class MyForm(forms.Form):
    content = AiEditorField()

配置

在你的 settings.py 中可以添加以下配置:

AIEDITOR_CONFIG = {
    'toolbarKeys': ['bold', 'italic', 'link', 'image'], # 工具栏
}

更多配置请访问:https://aieditor.dev/zh/

特性

  • 完整支持 AiEditor 的所有功能
  • 简单的 Django 集成
  • 支持文件上传(支持本地存储和云存储)
  • 支持自定义配置
  • Django Admin 集成

更新日志

v1.0.14 (2025-04-16)

  • 修复在settings.py中配置不生效的问题
  • 更新文档,添加正确的配置示例

v1.0.13 (2025-04-16)

  • 升级 AiEditor 到 1.3.6 版本
  • 新增高亮块功能支持
  • 新增文字计数器功能
  • 新增工具栏按钮大小调整功能
  • 优化粘贴配置,增强粘贴体验

文档

aiEditor 文档请访问:https://aieditor.dev/zh/

Django-AiEditor 文档请访问:https://github.com/mircool/django-aieditor

License

MIT License

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_aieditor-1.0.14.tar.gz (848.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_aieditor-1.0.14-py2.py3-none-any.whl (853.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_aieditor-1.0.14.tar.gz.

File metadata

  • Download URL: django_aieditor-1.0.14.tar.gz
  • Upload date:
  • Size: 848.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for django_aieditor-1.0.14.tar.gz
Algorithm Hash digest
SHA256 7b59d9de4d1df89b0a76815b3ad4adbbda7e56e53288db702914cc738b24bb89
MD5 2eff1905a81f65e9c1e50ec3a5bac970
BLAKE2b-256 68896c0554e16a5d964be244a267dab43747588e241398826c9a6e43c59bc4ed

See more details on using hashes here.

File details

Details for the file django_aieditor-1.0.14-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_aieditor-1.0.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 604e4e8c29a32981f87eb5ae32445676163ad4496b81de42ad3677b2f12bf66a
MD5 edd54ffec6d03249676b3d2dc75afc53
BLAKE2b-256 098b75bc90de5fbdbccb204da3443e40c51ddc2dbbaa2f638afc7ad34167adab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page