django-tiptap-suite 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. django_tiptap_suite-1.0.0/.github/workflows/build.yml +58 -0
  2. django_tiptap_suite-1.0.0/.gitignore +64 -0
  3. django_tiptap_suite-1.0.0/AUTO_BUILD_SPEC.md +66 -0
  4. django_tiptap_suite-1.0.0/CHANGELOG.md +27 -0
  5. django_tiptap_suite-1.0.0/LICENSE +21 -0
  6. django_tiptap_suite-1.0.0/MANIFEST.in +7 -0
  7. django_tiptap_suite-1.0.0/MODERN_EDITOR_SPEC.md +48 -0
  8. django_tiptap_suite-1.0.0/PKG-INFO +141 -0
  9. django_tiptap_suite-1.0.0/README.md +115 -0
  10. django_tiptap_suite-1.0.0/docs/getting_started.md +223 -0
  11. django_tiptap_suite-1.0.0/docs/images/logo.png +0 -0
  12. django_tiptap_suite-1.0.0/example_project/demo/__init__.py +1 -0
  13. django_tiptap_suite-1.0.0/example_project/demo/admin.py +6 -0
  14. django_tiptap_suite-1.0.0/example_project/demo/migrations/0001_initial.py +23 -0
  15. django_tiptap_suite-1.0.0/example_project/demo/migrations/__init__.py +0 -0
  16. django_tiptap_suite-1.0.0/example_project/demo/models.py +9 -0
  17. django_tiptap_suite-1.0.0/example_project/demo/views.py +1 -0
  18. django_tiptap_suite-1.0.0/example_project/example_project/__init__.py +1 -0
  19. django_tiptap_suite-1.0.0/example_project/example_project/settings.py +63 -0
  20. django_tiptap_suite-1.0.0/example_project/example_project/urls.py +9 -0
  21. django_tiptap_suite-1.0.0/example_project/example_project/wsgi.py +5 -0
  22. django_tiptap_suite-1.0.0/example_project/manage.py +18 -0
  23. django_tiptap_suite-1.0.0/frontend/package-lock.json +1856 -0
  24. django_tiptap_suite-1.0.0/frontend/package.json +25 -0
  25. django_tiptap_suite-1.0.0/frontend/src/index.js +490 -0
  26. django_tiptap_suite-1.0.0/frontend/src/styles.css +372 -0
  27. django_tiptap_suite-1.0.0/frontend/vite.config.js +29 -0
  28. django_tiptap_suite-1.0.0/pyproject.toml +40 -0
  29. django_tiptap_suite-1.0.0/pytest.ini +5 -0
  30. django_tiptap_suite-1.0.0/src/django_tiptap_suite/__init__.py +1 -0
  31. django_tiptap_suite-1.0.0/src/django_tiptap_suite/apps.py +6 -0
  32. django_tiptap_suite-1.0.0/src/django_tiptap_suite/conf.py +3 -0
  33. django_tiptap_suite-1.0.0/src/django_tiptap_suite/fields.py +7 -0
  34. django_tiptap_suite-1.0.0/src/django_tiptap_suite/static/django_tiptap_suite/tiptap-suite.min.css +1 -0
  35. django_tiptap_suite-1.0.0/src/django_tiptap_suite/static/django_tiptap_suite/tiptap-suite.min.js +114 -0
  36. django_tiptap_suite-1.0.0/src/django_tiptap_suite/templates/django_tiptap_suite/widget.html +29 -0
  37. django_tiptap_suite-1.0.0/src/django_tiptap_suite/urls.py +8 -0
  38. django_tiptap_suite-1.0.0/src/django_tiptap_suite/views.py +17 -0
  39. django_tiptap_suite-1.0.0/src/django_tiptap_suite/widgets.py +23 -0
  40. django_tiptap_suite-1.0.0/tests/__init__.py +1 -0
  41. django_tiptap_suite-1.0.0/tests/test_views.py +28 -0
  42. django_tiptap_suite-1.0.0/tests/test_widgets.py +22 -0
@@ -0,0 +1,58 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ tags:
7
+ - 'v*'
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - name: Install dependencies
19
+ run: |
20
+ python -m pip install --upgrade pip
21
+ pip install build twine
22
+ - name: Set up Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: "20"
26
+ - name: Build frontend assets
27
+ run: |
28
+ cd frontend
29
+ npm ci
30
+ npm run build
31
+ - name: Build package
32
+ run: python -m build
33
+ - name: Check package
34
+ run: twine check dist/*
35
+ - name: Upload artifacts
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ publish:
42
+ name: Publish to PyPI
43
+ needs: build
44
+ if: startsWith(github.ref, 'refs/tags/')
45
+ runs-on: ubuntu-latest
46
+ environment:
47
+ name: pypi
48
+ url: https://pypi.org/p/django-tiptap-suite
49
+ permissions:
50
+ id-token: write
51
+ steps:
52
+ - name: Download artifacts
53
+ uses: actions/download-artifact@v4
54
+ with:
55
+ name: dist
56
+ path: dist/
57
+ - name: Publish to PyPI
58
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,64 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual Environments
26
+ venv/
27
+ .venv/
28
+ env/
29
+ .env/
30
+ ENV/
31
+
32
+ # pytest
33
+ .pytest_cache/
34
+ .htmlcov/
35
+ htmlcov/
36
+ .coverage
37
+ .coverage.*
38
+
39
+ # Node / JS
40
+ node_modules/
41
+ npm-debug.log*
42
+ yarn-debug.log*
43
+ yarn-error.log*
44
+ .eslintcache
45
+ .parcel-cache
46
+
47
+ # Django local files
48
+ db.sqlite3
49
+ media/
50
+ static_root/
51
+ /example_project/db.sqlite3
52
+ /example_project/media/
53
+ /example_project/static_root/
54
+
55
+ # OS/IDE
56
+ .DS_Store
57
+ Thumbs.db
58
+ .idea/
59
+ .vscode/
60
+ *.suo
61
+ *.ntvs*
62
+ *.njsproj
63
+ *.sln
64
+ *.swp
@@ -0,0 +1,66 @@
1
+ # Autonomous Master Specification: `django-tiptap-suite`
2
+
3
+ ## 1. Project Overview & Architecture
4
+ `django-tiptap-suite` is an open-source Django rich text editor package published on PyPI.
5
+ It serves as a feature-complete replacement for outdated Django WYSIWYG editors (e.g., Summernote, CKEditor 4) by leveraging **Tiptap v2** (ProseMirror-based).
6
+
7
+ ### Key Features & Requirements:
8
+ - **Zero-Config Django Integration**: `TiptapEditorWidget(forms.Widget)` and `HTMLField(models.TextField)`.
9
+ - **Complete Interactive UI**:
10
+ - **Fixed Top Toolbar**: Bold, Italic, Headings (H1/H2/H3), Lists (Bullet/Numbered), Blockquote, Code Block, Link.
11
+ - **Slash Command Menu (`/`)**: Popup dropdown powered by `@tiptap/extension-suggestion` & `tippy.js` allowing fast block formatting.
12
+ - **Auto-Syncing**: Real-time content sync to hidden `<textarea>` for standard Django form POST submissions.
13
+ - **CSRF-Aware Image Uploads**: Built-in Django View handling drag-and-drop & image file insertion via `fetch()` with `X-CSRFToken`.
14
+ - **Pre-bundled Frontend Assets**: Single minified `.js` and `.css` files produced via Vite into Django's static directory.
15
+ - **Modern Packaging**: `pyproject.toml` using `hatchling`.
16
+
17
+ ---
18
+
19
+ ## 2. Directory Structure
20
+
21
+ ```text
22
+ django-tiptap-suite/
23
+ ├── .github/
24
+ │ └── workflows/
25
+ │ └── publish.yml
26
+ ├── example_project/
27
+ │ ├── manage.py
28
+ │ ├── example_project/
29
+ │ │ ├── __init__.py
30
+ │ │ ├── settings.py
31
+ │ │ ├── urls.py
32
+ │ │ └── wsgi.py
33
+ │ └── demo/
34
+ │ ├── __init__.py
35
+ │ ├── admin.py
36
+ │ ├── models.py
37
+ │ └── views.py
38
+ ├── src/
39
+ │ └── django_tiptap_suite/
40
+ │ ├── __init__.py
41
+ │ ├── apps.py
42
+ │ ├── conf.py
43
+ │ ├── fields.py
44
+ │ ├── static/
45
+ │ │ └── django_tiptap_suite/
46
+ │ │ ├── tiptap-suite.min.js
47
+ │ │ └── tiptap-suite.min.css
48
+ │ ├── templates/
49
+ │ │ └── django_tiptap_suite/
50
+ │ │ └── widget.html
51
+ │ ├── urls.py
52
+ │ ├── views.py
53
+ │ └── widgets.py
54
+ ├── frontend/
55
+ │ ├── package.json
56
+ │ ├── vite.config.js
57
+ │ └── src/
58
+ │ ├── index.js
59
+ │ └── styles.css
60
+ ├── tests/
61
+ │ ├── __init__.py
62
+ │ ├── test_widgets.py
63
+ │ └── test_views.py
64
+ ├── LICENSE
65
+ ├── README.md
66
+ └── pyproject.toml
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [1.0.0] - 2026-07-24
11
+
12
+ ### Added
13
+ - **Tiptap v2 Integration**: Core rich-text editing engine based on ProseMirror.
14
+ - **Distraction-Free UI/UX**: Premium, clean writing interface designed in the style of Notion, Ghost, and Linear.
15
+ - **Slash Commands Menu (`/`)**: Dropdown formatting options for Headings, Lists, Callouts, Code Blocks, Dividers, and Images.
16
+ - **Floating Bubble Menu**: Context-sensitive inline formatting toolbar (Bold, Italic, Strikethrough, Link) that appears on text selection.
17
+ - **CSRF-Aware Local Image Uploads**: Secure drag-and-drop & file selector image uploader routed directly to Django's media storage backend.
18
+ - **Django Admin Dark Mode Support**: Auto-detection and adaptation to default Django Admin light/dark color schemes.
19
+ - **Global Configuration**: Support for project-wide settings via `TIPTAP_SUITE_CONFIG` in Django `settings.py`.
20
+ - **Packaging & Manifests**: Explicit inclusion of templates and static compiled assets in source distributions via `MANIFEST.in` and `pyproject.toml`.
21
+ - **CI/CD Automation**: GitHub Actions workflow (`build.yml`) that runs tests, builds frontend/backend bundles, and deploys automatically to PyPI on version tags.
22
+ - **Detailed Step-by-Step Documentation**: Created a complete getting started and integration guide (`docs/getting_started.md`).
23
+
24
+ ### Fixed
25
+ - Fixed a bug where clicking the empty bottom space in the editor wrapper failed to focus the input cursor.
26
+ - Fixed a bug where Django Admin base styles stripped bullet list markers, ordered list numbers, and text paddings inside the editing area.
27
+ - Fixed styling of blockquotes, links, inline code elements, and images to render beautifully inside Django forms.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Giuseppe Iacovelli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ recursive-include src/django_tiptap_suite/templates *
5
+ recursive-include src/django_tiptap_suite/static *
6
+ recursive-exclude * __pycache__
7
+ recursive-exclude * *.py[co]
@@ -0,0 +1,48 @@
1
+ # Specification & Implementation Guide: `django-tiptap-suite` (Ultra-Modern UI)
2
+
3
+ ## 1. Vision & UI/UX Requirements
4
+ We are rebuilding the frontend of `django-tiptap-suite` from scratch.
5
+ The editor must **not** look like a classic 2010 WYSIWYG editor. It must match the design standards of **Notion, Ghost, and Linear**.
6
+
7
+ ### Mandatory Features:
8
+ - **Clean Container**: Border-radius, soft elevation shadow, clean typography (`Inter`/system-ui), auto-focus ring.
9
+ - **Fixed & Floating Toolbars**:
10
+ - Top Toolbar with SVG Icons (Lucide Icons via SVG or Feather Icons).
11
+ - **Bubble Menu**: Floating formatting toolbar that pops up when selecting text.
12
+ - **Rich Slash Commands (`/`)**:
13
+ - Typing `/` opens a clean dropdown with icons, titles, and descriptions.
14
+ - Supports: Heading 1, Heading 2, Heading 3, Bullet List, Numbered List, Callout Box, Code Block, Horizontal Rule, Image Upload.
15
+ - **Syntax & Code Blocks**: Clean dark-themed syntax container for code snippets.
16
+ - **Responsive & Dark Mode Compatible**: Seamlessly inherits colors from Django Admin light/dark mode.
17
+
18
+ ---
19
+
20
+ ## 2. Updated Package Dependencies (`frontend/package.json`)
21
+
22
+ Ensure `frontend/package.json` contains:
23
+ ```json
24
+ {
25
+ "name": "django-tiptap-suite-frontend",
26
+ "private": true,
27
+ "version": "0.1.0",
28
+ "type": "module",
29
+ "scripts": {
30
+ "build": "vite build"
31
+ },
32
+ "dependencies": {
33
+ "@tiptap/core": "^2.2.0",
34
+ "@tiptap/extension-bubble-menu": "^2.2.0",
35
+ "@tiptap/extension-code-block-lowlight": "^2.2.0",
36
+ "@tiptap/extension-image": "^2.2.0",
37
+ "@tiptap/extension-link": "^2.2.0",
38
+ "@tiptap/extension-placeholder": "^2.2.0",
39
+ "@tiptap/extension-suggestion": "^2.2.0",
40
+ "@tiptap/starter-kit": "^2.2.0",
41
+ "lowlight": "^3.1.0",
42
+ "lucide": "^0.300.0",
43
+ "tippy.js": "^6.3.7"
44
+ },
45
+ "devDependencies": {
46
+ "vite": "^5.0.0"
47
+ }
48
+ }
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-tiptap-suite
3
+ Version: 1.0.0
4
+ Summary: A modern, headless Tiptap v2 rich text editor widget for Django.
5
+ Project-URL: Homepage, https://github.com/IacoM/django-tiptap-suite
6
+ Project-URL: Issues, https://github.com/IacoM/django-tiptap-suite/issues
7
+ Author-email: Your Name <your.email@example.com>
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Classifier: Framework :: Django
11
+ Classifier: Framework :: Django :: 4.2
12
+ Classifier: Framework :: Django :: 5.0
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: django>=4.2
19
+ Requires-Dist: pillow>=9.0.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: black; extra == 'dev'
22
+ Requires-Dist: pytest; extra == 'dev'
23
+ Requires-Dist: pytest-django; extra == 'dev'
24
+ Requires-Dist: ruff; extra == 'dev'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Django Tiptap Suite
28
+
29
+ <p align="center">
30
+ <img src="docs/images/logo.png" alt="Django Tiptap Suite Logo" width="150" height="150">
31
+ </p>
32
+
33
+ [![PyPI version](https://img.shields.io/pypi/v/django-tiptap-suite.svg)](https://pypi.org/project/django-tiptap-suite/)
34
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
35
+
36
+ A modern, high-quality, and feature-complete rich text editor for Django based on **Tiptap v2**. It offers a premium, Notion-like distraction-free writing experience with fixed & floating toolbars, responsive designs, automatic dark-mode support matching Django Admin, and CSRF-secure local image uploads.
37
+
38
+ 📖 **[Read the Step-by-Step Getting Started Guide](docs/getting_started.md)**
39
+
40
+ ---
41
+
42
+ ## Features
43
+
44
+ - 🦄 **Modern UI/UX**: Designed to look like Notion, Ghost, and Linear—no legacy 2010s rich-text container vibes.
45
+ - ⚡ **Slash Command Menu (`/`)**: Type `/` to open a quick-access dropdown for headings, lists, quotes, dividers, and images.
46
+ - 💬 **Bubble Menu**: A floating formatting context menu that automatically appears when selecting text.
47
+ - 🎨 **Dark Mode Native**: Automatically detects and adapts to the Django Admin light/dark modes.
48
+ - 🖼️ **CSRF-Safe Local Image Uploads**: Built-in drag-and-drop & file selection image uploads synced securely to Django's file storage.
49
+ - ⚙️ **Zero Configuration**: Works out of the box with standard Django forms and model fields.
50
+ - 🛠️ **Configurable**: Define global styles, placeholders, and widget behaviors via Django Settings.
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ Install the package via `pip`:
57
+
58
+ ```bash
59
+ pip install django-tiptap-suite
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Setup
65
+
66
+ 1. Add `django_tiptap_suite` to your `INSTALLED_APPS` in `settings.py`:
67
+
68
+ ```python
69
+ INSTALLED_APPS = [
70
+ # ...
71
+ "django.contrib.staticfiles",
72
+ "django_tiptap_suite",
73
+ # ...
74
+ ]
75
+ ```
76
+
77
+ 2. Include the package's URLs in your project's main `urls.py` (required for CSRF-safe image uploads):
78
+
79
+ ```python
80
+ from django.urls import path, include
81
+
82
+ urlpatterns = [
83
+ path("admin/", admin.site.urls),
84
+ path("tiptap/", include("django_tiptap_suite.urls", namespace="django_tiptap_suite")),
85
+ ]
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Usage
91
+
92
+ ### In Django Models
93
+ The easiest way to use the editor is via the `HTMLField`:
94
+
95
+ ```python
96
+ from django.db import models
97
+ from django_tiptap_suite.fields import HTMLField
98
+
99
+ class Post(models.Model):
100
+ title = models.CharField(max_length=200)
101
+ content = HTMLField()
102
+ ```
103
+
104
+ ### In Django Forms / Admin
105
+ You can also apply the widget manually to any standard Django `TextField`:
106
+
107
+ ```python
108
+ from django import forms
109
+ from django_tiptap_suite.widgets import TiptapEditorWidget
110
+ from .models import Post
111
+
112
+ class PostForm(forms.ModelForm):
113
+ class Meta:
114
+ model = Post
115
+ fields = "__all__"
116
+ widgets = {
117
+ "content": TiptapEditorWidget(config={
118
+ "placeholder": "Start typing your masterpiece here...",
119
+ }),
120
+ }
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Customization & Configuration
126
+
127
+ You can globally configure default settings for the editor by adding `TIPTAP_SUITE_CONFIG` to your `settings.py`:
128
+
129
+ ```python
130
+ # settings.py
131
+
132
+ TIPTAP_SUITE_CONFIG = {
133
+ "placeholder": "Type '/' for commands or start writing...",
134
+ }
135
+ ```
136
+
137
+ ---
138
+
139
+ ## License
140
+
141
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,115 @@
1
+ # Django Tiptap Suite
2
+
3
+ <p align="center">
4
+ <img src="docs/images/logo.png" alt="Django Tiptap Suite Logo" width="150" height="150">
5
+ </p>
6
+
7
+ [![PyPI version](https://img.shields.io/pypi/v/django-tiptap-suite.svg)](https://pypi.org/project/django-tiptap-suite/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ A modern, high-quality, and feature-complete rich text editor for Django based on **Tiptap v2**. It offers a premium, Notion-like distraction-free writing experience with fixed & floating toolbars, responsive designs, automatic dark-mode support matching Django Admin, and CSRF-secure local image uploads.
11
+
12
+ 📖 **[Read the Step-by-Step Getting Started Guide](docs/getting_started.md)**
13
+
14
+ ---
15
+
16
+ ## Features
17
+
18
+ - 🦄 **Modern UI/UX**: Designed to look like Notion, Ghost, and Linear—no legacy 2010s rich-text container vibes.
19
+ - ⚡ **Slash Command Menu (`/`)**: Type `/` to open a quick-access dropdown for headings, lists, quotes, dividers, and images.
20
+ - 💬 **Bubble Menu**: A floating formatting context menu that automatically appears when selecting text.
21
+ - 🎨 **Dark Mode Native**: Automatically detects and adapts to the Django Admin light/dark modes.
22
+ - 🖼️ **CSRF-Safe Local Image Uploads**: Built-in drag-and-drop & file selection image uploads synced securely to Django's file storage.
23
+ - ⚙️ **Zero Configuration**: Works out of the box with standard Django forms and model fields.
24
+ - 🛠️ **Configurable**: Define global styles, placeholders, and widget behaviors via Django Settings.
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ Install the package via `pip`:
31
+
32
+ ```bash
33
+ pip install django-tiptap-suite
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Setup
39
+
40
+ 1. Add `django_tiptap_suite` to your `INSTALLED_APPS` in `settings.py`:
41
+
42
+ ```python
43
+ INSTALLED_APPS = [
44
+ # ...
45
+ "django.contrib.staticfiles",
46
+ "django_tiptap_suite",
47
+ # ...
48
+ ]
49
+ ```
50
+
51
+ 2. Include the package's URLs in your project's main `urls.py` (required for CSRF-safe image uploads):
52
+
53
+ ```python
54
+ from django.urls import path, include
55
+
56
+ urlpatterns = [
57
+ path("admin/", admin.site.urls),
58
+ path("tiptap/", include("django_tiptap_suite.urls", namespace="django_tiptap_suite")),
59
+ ]
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Usage
65
+
66
+ ### In Django Models
67
+ The easiest way to use the editor is via the `HTMLField`:
68
+
69
+ ```python
70
+ from django.db import models
71
+ from django_tiptap_suite.fields import HTMLField
72
+
73
+ class Post(models.Model):
74
+ title = models.CharField(max_length=200)
75
+ content = HTMLField()
76
+ ```
77
+
78
+ ### In Django Forms / Admin
79
+ You can also apply the widget manually to any standard Django `TextField`:
80
+
81
+ ```python
82
+ from django import forms
83
+ from django_tiptap_suite.widgets import TiptapEditorWidget
84
+ from .models import Post
85
+
86
+ class PostForm(forms.ModelForm):
87
+ class Meta:
88
+ model = Post
89
+ fields = "__all__"
90
+ widgets = {
91
+ "content": TiptapEditorWidget(config={
92
+ "placeholder": "Start typing your masterpiece here...",
93
+ }),
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Customization & Configuration
100
+
101
+ You can globally configure default settings for the editor by adding `TIPTAP_SUITE_CONFIG` to your `settings.py`:
102
+
103
+ ```python
104
+ # settings.py
105
+
106
+ TIPTAP_SUITE_CONFIG = {
107
+ "placeholder": "Type '/' for commands or start writing...",
108
+ }
109
+ ```
110
+
111
+ ---
112
+
113
+ ## License
114
+
115
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.