Headless Wagtail Advanced Form Builder - Complete REST API for modern frontend frameworks
Project description
Headless Wagtail Advanced Form Builder
A powerful headless-first Wagtail Advanced Form Builder with complete REST API for modern frontend frameworks like React, Vue, Angular, and mobile applications.
๐จ Important: This is a separate package from the original
wagtail-advanced-form-builder. Chooseheadless-wagtail-advanced-form-builderfor modern headless/API-first applications, or the original for traditional Wagtail template only usage.
๐ Headless API Features
Complete REST API with Django Ninja - Build modern frontend applications with React, Vue, Angular, or any JavaScript framework using our comprehensive headless API.
API Capabilities
- ๐ Form Retrieval API - Get form schemas with complete field definitions and validation rules
- ๐ค Form Submission API - Submit forms with automatic validation and processing
- ๐ Security Built-in - CSRF protection, reCAPTCHA v2/v3 integration, and rate limiting
- ๐ง Email Integration - Automatic email sending with Celery background processing
- ๐ Auto-Generated Documentation - Interactive API docs at
/docsendpoint - ๐ฏ Type-Safe Schemas - Complete Pydantic schemas for all form fields and responses
Quick API Example
// Get form schema
const response = await fetch('/api/form_by_path/contact-form/');
const formSchema = await response.json();
// Submit form data
await fetch('/api/form_by_path/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfToken
},
body: JSON.stringify({
path: 'contact-form',
form_fields: { name: 'John', email: 'john@example.com' },
recaptcha_token: recaptchaToken // optional
})
});
Versions
This package currently only supports Wagtail 6.4 above.
Version 1.0.0
Brand new headless API capabilities for use with Wagtail version 6.4.X
- ๐ฏ Complete Headless API with Django Ninja for modern frontend frameworks
- ๐ Full Schema Models for all form fields and pages with Pydantic validation
- ๐ RESTful APIs for form retrieval, submission, and validation
- ๐ Security Features including optional django-recaptcha and CSRF protection
- โก Background Processing with Celery for email sending and heavy tasks
- ๐ Auto-Generated API Documentation with interactive OpenAPI interface
- ๐๏ธ Enhanced Conditional Logic with improved rule engine
About
Headless WAF Builder is a comprehensive headless-first extension that enhances Wagtail's built-in Form Builder with:
- ๐๏ธ Advanced Conditional Logic - Show/hide fields based on user input with complex rule sets
- ๐ Headless API Support - Complete REST API for frontend frameworks and mobile apps
- ๐ฑ Modern Field Types - Extended field library including phone, date, and custom validation
- ๐ง Developer-Friendly - Easy integration, comprehensive documentation, and extensible architecture
๐ค Why Choose Headless WAF Builder?
| Feature | Headless WAF Builder | Original wagtail-advanced-form-builder |
|---|---|---|
| ๐ REST API | โ Complete Django Ninja API | โ No API |
| ๐ฑ Frontend Frameworks | โ React, Vue, Angular, Mobile | โ Wagtail templates only |
| ๐ Modern Security | โ CSRF, reCAPTCHA, Rate limiting | โ ๏ธ Basic |
| ๐ API Documentation | โ Auto-generated OpenAPI docs | โ No API docs |
| โก Background Processing | โ Celery integration | โ Synchronous only |
| ๐ฏ Type Safety | โ Pydantic schemas | โ No schemas |
| ๐ Headless CMS Ready | โ Built for decoupled architecture | โ Traditional Wagtail CMS + Django Templates |
Choose headless-waf-builder if you're building:
- ๐ Modern SPA applications (React, Vue, Angular)
- ๐ฑ Mobile apps that need form APIs
- ๐ Headless/decoupled Wagtail sites
- ๐ Multi-channel content delivery
- ๐ฏ API-first applications
๐ ๏ธ Installation & Setup
Basic Installation
Production Installation
pip install headless-waf-builder
Add to your INSTALLED_APPS:
INSTALLED_APPS = [
# ... other apps
'headless_waf_builder',
# ...
]
โจ Modern Architecture: The new
headless_waf_builderpackage follows modern Python packaging standards withsrc/layout andpyproject.tomlconfiguration.
Headless API Setup
# urls.py
from headless_waf_builder.api.router import headless_waf_builder_api
urlpatterns = [
# ... your existing URLs
path("api/", headless_waf_builder_api.urls),
]
Run migrations:
./manage.py migrate
๐ After the migration succeed! Your API will be available at /api/ with documentation at /api/docs
๐ Comprehensive Field Support
Core Field Types
- ๐ Text Fields - Single line, multi-line with validation
- ๐ง Email Field - Built-in email validation
- ๐ข Number Field - Numeric input with min/max validation
- ๐ Phone Field - International phone number support
- ๐ Simple Date Field - Date picker with age validation
- ๐ URL Field - URL validation and formatting
- ๐ Hidden Field - For tracking and default values
Advanced Input Types
- ๐ Dropdown/Select - Single and multi-select options
- โ Checkbox Fields - Single checkbox and checkbox groups
- ๐ Radio Buttons - Single choice with custom layouts
- ๐จ HTML Field - Rich content and custom markup
- ๐ฑ Responsive Layouts - Side-by-side and mobile-optimized displays
๐ฏ Conditional Logic Engine
Create dynamic forms with sophisticated show/hide rules:
- Comparison Operators:
equals,not equals,greater than,less than,contains - String Matching:
starts with,ends with,is blank,is not blank - Multiple Conditions: Combine rules with AND/OR logic
- Cross-Field Dependencies: Field visibility based on other field values
- Real-time Updates: Instant field visibility changes as users interact
๐ Headless API Reference
Endpoints
GET /api/form_by_path/{path}
Retrieve form schema and configuration
{
"id": 1,
"title": "Contact Form",
"fields": [
{
"id": 1,
"type": "singleline",
"name": "full_name",
"label": "Full Name",
"required": true,
"rules": {
"action": "show",
"conditions": [...]
}
}
],
"use_google_recaptcha": true,
"google_recaptcha_public_key": "..."
}
POST /api/form_by_path/
Submit form data with validation
{
"path": "contact-form",
"form_fields": {
"full_name": "John Doe",
"email": "john@example.com"
},
"recaptcha_token": "..."
}
GET /api/csrf/
Get CSRF token for secure submissions
{
"csrftoken": "abc123..."
}
๐ Documentation
The complete documentation is available at here
๐ Getting Help
- ๐ Bug Reports: Issue Tracker
- ๐ก Feature Requests: GitHub Discussions
๐ฅ Authors
- Richard Blake, Dan Brosnan & Vincent Tran (Octave)
๐ License
This project is licensed under the BSD License - see the LICENSE file for details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file headless_waf_builder-0.0.1b1.tar.gz.
File metadata
- Download URL: headless_waf_builder-0.0.1b1.tar.gz
- Upload date:
- Size: 222.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a631ce5dad4e4f1b5b4561d8589179a044d79c8ca233809132a3e7a50f17a5
|
|
| MD5 |
0bf590996272ccaa3293d844b486a410
|
|
| BLAKE2b-256 |
72f5ed0f7f42a47078a479c40cbade01aa82dd9d0c163c9945beb7cb0b6d4f98
|
Provenance
The following attestation bundles were made for headless_waf_builder-0.0.1b1.tar.gz:
Publisher:
publish-to-pypi.yml on octavenz/headless-wagtail-advanced-form-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headless_waf_builder-0.0.1b1.tar.gz -
Subject digest:
99a631ce5dad4e4f1b5b4561d8589179a044d79c8ca233809132a3e7a50f17a5 - Sigstore transparency entry: 497566799
- Sigstore integration time:
-
Permalink:
octavenz/headless-wagtail-advanced-form-builder@a7ef28e423137cc847485f8fd455018f162c783a -
Branch / Tag:
refs/tags/v0.0.1beta1 - Owner: https://github.com/octavenz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a7ef28e423137cc847485f8fd455018f162c783a -
Trigger Event:
push
-
Statement type:
File details
Details for the file headless_waf_builder-0.0.1b1-py3-none-any.whl.
File metadata
- Download URL: headless_waf_builder-0.0.1b1-py3-none-any.whl
- Upload date:
- Size: 56.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747c77e30e32c91bdb8420ea8394711f74b4f4d20d053dc5acc64ae3be3b6ac6
|
|
| MD5 |
3d8b6f3ec5b62f5cb0c6fb148d9fbbaa
|
|
| BLAKE2b-256 |
6aeb3a7434894771c5abeb05c053e39c71292033fc160d696bf9de4af91e9905
|
Provenance
The following attestation bundles were made for headless_waf_builder-0.0.1b1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on octavenz/headless-wagtail-advanced-form-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headless_waf_builder-0.0.1b1-py3-none-any.whl -
Subject digest:
747c77e30e32c91bdb8420ea8394711f74b4f4d20d053dc5acc64ae3be3b6ac6 - Sigstore transparency entry: 497566813
- Sigstore integration time:
-
Permalink:
octavenz/headless-wagtail-advanced-form-builder@a7ef28e423137cc847485f8fd455018f162c783a -
Branch / Tag:
refs/tags/v0.0.1beta1 - Owner: https://github.com/octavenz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a7ef28e423137cc847485f8fd455018f162c783a -
Trigger Event:
push
-
Statement type: